const TargetData *TD;
ExecutionEngineState state;
bool LazyCompilationDisabled;
+ bool GVCompilationDisabled;
bool SymbolSearchingDisabled;
protected:
bool isLazyCompilationDisabled() const {
return LazyCompilationDisabled;
}
+
+ /// DisableGVCompilation - If called, the JIT will abort if it's asked to allocate
+ /// space and populate a GlobalVariable.
+ 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.
ExecutionEngine::ExecutionEngine(ModuleProvider *P) : LazyFunctionCreator(0) {
LazyCompilationDisabled = false;
+ GVCompilationDisabled = false;
SymbolSearchingDisabled = false;
Modules.push_back(P);
assert(P && "ModuleProvider is null?");
addGlobalMapping(GV, Ptr);
}
} else {
+ if (isGVCompilationDisabled()) {
+ cerr << "Compilation of GlobalVariable is disabled!\n";
+ abort();
+ }
// If the global hasn't been emitted to memory yet, allocate space and
// emit it into memory. It goes in the same array as the generated
// code, jump tables, etc.