if lazy compilation is disabled, print an error message and abort if

lazy compilation is ever attempted

llvm-svn: 31602
This commit is contained in:
Chris Lattner 2006-11-09 19:32:13 +00:00
parent 87aee74ccb
commit 5fdbe55979
1 changed files with 7 additions and 0 deletions

View 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,