[llvm-commits] [llvm] r96037 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
Jeffrey Yasskin
jyasskin at google.com
Fri Feb 12 15:05:33 PST 2010
Author: jyasskin
Date: Fri Feb 12 17:05:31 2010
New Revision: 96037
URL: http://llvm.org/viewvc/llvm-project?rev=96037&view=rev
Log:
Make JIT::runFunction clean up the generated stub function.
Patch by Shivram K!
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=96037&r1=96036&r2=96037&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Fri Feb 12 17:05:31 2010
@@ -553,8 +553,12 @@
else
ReturnInst::Create(F->getContext(), StubBB); // Just return void.
- // Finally, return the value returned by our nullary stub function.
- return runFunction(Stub, std::vector<GenericValue>());
+ // Finally, call our nullary stub function.
+ GenericValue Result = runFunction(Stub, std::vector<GenericValue>());
+ // Erase it, since no other function can have a reference to it.
+ Stub->eraseFromParent();
+ // And return the result.
+ return Result;
}
void JIT::RegisterJITEventListener(JITEventListener *L) {
More information about the llvm-commits
mailing list