if lazy compilation is disabled, print an error message and abort if
authorChris Lattner <sabre@nondot.org>
Thu, 9 Nov 2006 19:32:13 +0000 (19:32 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 9 Nov 2006 19:32:13 +0000 (19:32 +0000)
lazy compilation is ever attempted

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31602 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JITEmitter.cpp

index 911aa8c20563c487ce13a5bd2f802a3ed7c7907f..1c2d5d3185ae7be7ef0903466ee190880d80cbde 100644 (file)
@@ -613,6 +613,13 @@ void *JITResolver::JITCompilerFn(void *Stub) {
          "This is not a known stub!");
   Function *F = (--I)->second;
 
+  // If disabled, emit a useful error message and abort.
+  if (TheJIT->isLazyCompilationDisabled()) {
+    std::cerr << "LLVM JIT requested to do lazy compilation of function '"
+              << F->getName() << "' when lazy compiles are disabled!\n";
+    abort();
+  }
+  
   // We might like to remove the stub from the StubToFunction map.
   // We can't do that! Multiple threads could be stuck, waiting to acquire the
   // lock above. As soon as the 1st function finishes compiling the function,