[llvm-commits] [llvm] r85330 - in /llvm/trunk: include/llvm/ExecutionEngine/ExecutionEngine.h tools/lli/lli.cpp unittests/ExecutionEngine/JIT/JITTest.cpp

Jeffrey Yasskin jyasskin at google.com
Tue Oct 27 15:39:43 PDT 2009


Author: jyasskin
Date: Tue Oct 27 17:39:42 2009
New Revision: 85330

URL: http://llvm.org/viewvc/llvm-project?rev=85330&view=rev
Log:
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.

Modified:
    llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h
    llvm/trunk/tools/lli/lli.cpp
    llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp

Modified: llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h?rev=85330&r1=85329&r2=85330&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h Tue Oct 27 17:39:42 2009
@@ -319,7 +319,7 @@
   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 @@
   /// 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

Modified: llvm/trunk/tools/lli/lli.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/lli.cpp?rev=85330&r1=85329&r2=85330&view=diff

==============================================================================
--- llvm/trunk/tools/lli/lli.cpp (original)
+++ llvm/trunk/tools/lli/lli.cpp Tue Oct 27 17:39:42 2009
@@ -165,7 +165,7 @@
 
   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.

Modified: llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp?rev=85330&r1=85329&r2=85330&view=diff

==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp (original)
+++ llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp Tue Oct 27 17:39:42 2009
@@ -304,7 +304,7 @@
   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 @@
 #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 @@
 // 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 =





More information about the llvm-commits mailing list