1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Make JIT::runFunction clean up the generated stub function.

Patch by Shivram K!

llvm-svn: 96037
This commit is contained in:
Jeffrey Yasskin 2010-02-12 23:05:31 +00:00
parent e90d092fd7
commit 72e77cf286

View File

@ -553,8 +553,12 @@ GenericValue JIT::runFunction(Function *F,
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) {