diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2009-10-27 22:39:42 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2009-10-27 22:39:42 +0000 |
commit | 8c4e2231017c5ff51cee8c7de384e7d105883287 (patch) | |
tree | 72f878ea1672007c3f79c0d3666a541ff3351931 | |
parent | 85196b544a2832e3da5024dd2b9559f0791a2f86 (diff) | |
download | external_llvm-8c4e2231017c5ff51cee8c7de384e7d105883287.zip external_llvm-8c4e2231017c5ff51cee8c7de384e7d105883287.tar.gz external_llvm-8c4e2231017c5ff51cee8c7de384e7d105883287.tar.bz2 |
Revert the API changes from r85295 to make it easier for people to build
against both 2.6 and HEAD. The default is still changed to eager jitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85330 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 11 | ||||
-rw-r--r-- | tools/lli/lli.cpp | 2 | ||||
-rw-r--r-- | unittests/ExecutionEngine/JIT/JITTest.cpp | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index 0471824..47c10b3 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -319,7 +319,7 @@ public: virtual void RegisterJITEventListener(JITEventListener *) {} virtual void UnregisterJITEventListener(JITEventListener *) {} - /// EnableLazyCompilation - When lazy compilation is off (the default), the + /// DisableLazyCompilation - When lazy compilation is off (the default), the /// JIT will eagerly compile every function reachable from the argument to /// getPointerToFunction. If lazy compilation is turned on, the JIT will only /// compile the one function and emit stubs to compile the rest when they're @@ -332,12 +332,17 @@ public: /// stub, and 2) any thread modifying LLVM IR must hold the JIT's lock /// (ExecutionEngine::lock) or otherwise ensure that no other thread calls a /// lazy stub. See http://llvm.org/PR5184 for details. - void EnableLazyCompilation(bool Enabled = true) { - CompilingLazily = Enabled; + void DisableLazyCompilation(bool Disabled = true) { + CompilingLazily = !Disabled; } bool isCompilingLazily() const { return CompilingLazily; } + // Deprecated in favor of isCompilingLazily (to reduce double-negatives). + // Remove this in LLVM 2.8. + bool isLazyCompilationDisabled() const { + return !CompilingLazily; + } /// DisableGVCompilation - If called, the JIT will abort if it's asked to /// allocate space and populate a GlobalVariable that is not internal to diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 0fa39da..218bb93 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -165,7 +165,7 @@ int main(int argc, char **argv, char * const *envp) { EE->RegisterJITEventListener(createOProfileJITEventListener()); - EE->EnableLazyCompilation(!NoLazyCompilation); + EE->DisableLazyCompilation(NoLazyCompilation); // If the user specifically requested an argv[0] to pass into the program, // do it now. diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp index 3e1f423..2e0f931 100644 --- a/unittests/ExecutionEngine/JIT/JITTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITTest.cpp @@ -304,7 +304,7 @@ TEST_F(JITTest, FarCallToKnownFunction) { Builder.CreateRet(result); TheJIT->EnableDlsymStubs(false); - TheJIT->EnableLazyCompilation(false); + TheJIT->DisableLazyCompilation(true); int (*TestFunctionPtr)() = reinterpret_cast<int(*)()>( (intptr_t)TheJIT->getPointerToFunction(TestFunction)); // This used to crash in trying to call PlusOne(). @@ -314,7 +314,7 @@ TEST_F(JITTest, FarCallToKnownFunction) { #if !defined(__arm__) && !defined(__powerpc__) && !defined(__ppc__) // Test a function C which calls A and B which call each other. TEST_F(JITTest, NonLazyCompilationStillNeedsStubs) { - TheJIT->EnableLazyCompilation(false); + TheJIT->DisableLazyCompilation(true); const FunctionType *Func1Ty = cast<FunctionType>(TypeBuilder<void(void), false>::get(Context)); @@ -370,7 +370,7 @@ TEST_F(JITTest, NonLazyCompilationStillNeedsStubs) { // Regression test for PR5162. This used to trigger an AssertingVH inside the // JIT's Function to stub mapping. TEST_F(JITTest, NonLazyLeaksNoStubs) { - TheJIT->EnableLazyCompilation(false); + TheJIT->DisableLazyCompilation(true); // Create two functions with a single basic block each. const FunctionType *FuncTy = |