Add DisableGVCompilation which forces the JIT to assert when it tries to allocate...
[oota-llvm.git] / lib / ExecutionEngine / JIT / JIT.cpp
index 39ecc2796c77dcbc4a263d403043284dabcf6acc..383b3804758e0923ba8d9528a739a94ce7b0f924 100644 (file)
@@ -552,6 +552,10 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) {
     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.