llvm.org GIT mirror llvm / 18fec73
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 Jeffrey Yasskin 10 years ago
3 changed file(s) with 12 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
318318 virtual void RegisterJITEventListener(JITEventListener *) {}
319319 virtual void UnregisterJITEventListener(JITEventListener *) {}
320320
321 /// EnableLazyCompilation - When lazy compilation is off (the default), the
321 /// DisableLazyCompilation - When lazy compilation is off (the default), the
322322 /// JIT will eagerly compile every function reachable from the argument to
323323 /// getPointerToFunction. If lazy compilation is turned on, the JIT will only
324324 /// compile the one function and emit stubs to compile the rest when they're
331331 /// stub, and 2) any thread modifying LLVM IR must hold the JIT's lock
332332 /// (ExecutionEngine::lock) or otherwise ensure that no other thread calls a
333333 /// lazy stub. See http://llvm.org/PR5184 for details.
334 void EnableLazyCompilation(bool Enabled = true) {
335 CompilingLazily = Enabled;
334 void DisableLazyCompilation(bool Disabled = true) {
335 CompilingLazily = !Disabled;
336336 }
337337 bool isCompilingLazily() const {
338338 return CompilingLazily;
339 }
340 // Deprecated in favor of isCompilingLazily (to reduce double-negatives).
341 // Remove this in LLVM 2.8.
342 bool isLazyCompilationDisabled() const {
343 return !CompilingLazily;
339344 }
340345
341346 /// DisableGVCompilation - If called, the JIT will abort if it's asked to
164164
165165 EE->RegisterJITEventListener(createOProfileJITEventListener());
166166
167 EE->EnableLazyCompilation(!NoLazyCompilation);
167 EE->DisableLazyCompilation(NoLazyCompilation);
168168
169169 // If the user specifically requested an argv[0] to pass into the program,
170170 // do it now.
303303 Builder.CreateRet(result);
304304
305305 TheJIT->EnableDlsymStubs(false);
306 TheJIT->EnableLazyCompilation(false);
306 TheJIT->DisableLazyCompilation(true);
307307 int (*TestFunctionPtr)() = reinterpret_cast(
308308 (intptr_t)TheJIT->getPointerToFunction(TestFunction));
309309 // This used to crash in trying to call PlusOne().
313313 #if !defined(__arm__) && !defined(__powerpc__) && !defined(__ppc__)
314314 // Test a function C which calls A and B which call each other.
315315 TEST_F(JITTest, NonLazyCompilationStillNeedsStubs) {
316 TheJIT->EnableLazyCompilation(false);
316 TheJIT->DisableLazyCompilation(true);
317317
318318 const FunctionType *Func1Ty =
319319 cast(TypeBuilder::get(Context));
369369 // Regression test for PR5162. This used to trigger an AssertingVH inside the
370370 // JIT's Function to stub mapping.
371371 TEST_F(JITTest, NonLazyLeaksNoStubs) {
372 TheJIT->EnableLazyCompilation(false);
372 TheJIT->DisableLazyCompilation(true);
373373
374374 // Create two functions with a single basic block each.
375375 const FunctionType *FuncTy =