DisableGVCompilation should not abort on internal GlobalValue's.
[oota-llvm.git] / include / llvm / ExecutionEngine / ExecutionEngine.h
index edcddde2e390bab6335ae574193a9928305a5404..327e9c6aa9290403ec6ff32b4b26b5bb0aa43ef9 100644 (file)
@@ -65,6 +65,7 @@ class ExecutionEngine {
   const TargetData *TD;
   ExecutionEngineState state;
   bool LazyCompilationDisabled;
+  bool GVCompilationDisabled;
   bool SymbolSearchingDisabled;
 
 protected:
@@ -75,6 +76,9 @@ protected:
   void setTargetData(const TargetData *td) {
     TD = td;
   }
+  
+  /// getMemoryforGV - Allocate memory for a global variable.
+  virtual char* getMemoryForGV(const GlobalVariable* GV);
 
   // To avoid having libexecutionengine depend on the JIT and interpreter
   // libraries, the JIT and Interpreter set these functions to ctor pointers
@@ -156,9 +160,13 @@ public:
                                 const std::vector<GenericValue> &ArgValues) = 0;
 
   /// runStaticConstructorsDestructors - This method is used to execute all of
-  /// the static constructors or destructors for a module, depending on the
+  /// the static constructors or destructors for a program, depending on the
   /// value of isDtors.
   void runStaticConstructorsDestructors(bool isDtors);
+  /// runStaticConstructorsDestructors - This method is used to execute all of
+  /// the static constructors or destructors for a module, depending on the
+  /// value of isDtors.
+  void runStaticConstructorsDestructors(Module *module, bool isDtors);
   
   
   /// runFunctionAsMain - This is a helper function which wraps runFunction to
@@ -254,6 +262,17 @@ public:
   bool isLazyCompilationDisabled() const {
     return LazyCompilationDisabled;
   }
+
+  /// DisableGVCompilation - If called, the JIT will abort if it's asked to
+  /// allocate space and populate a GlobalVariable that is not internal to
+  /// the module.
+  void DisableGVCompilation(bool Disabled = true) {
+    GVCompilationDisabled = Disabled;
+  }
+  bool isGVCompilationDisabled() const {
+    return GVCompilationDisabled;
+  }
+
   /// DisableSymbolSearching - If called, the JIT will not try to lookup unknown
   /// symbols with dlsym.  A client can still use InstallLazyFunctionCreator to
   /// resolve symbols in a custom way.