forked from OSchip/llvm-project
Make JIT::runFunction clean up the generated stub function.
Patch by Shivram K! llvm-svn: 96037
This commit is contained in:
parent
4ad96055fb
commit
2d36eb6e18
|
@ -553,8 +553,12 @@ GenericValue JIT::runFunction(Function *F,
|
||||||
else
|
else
|
||||||
ReturnInst::Create(F->getContext(), StubBB); // Just return void.
|
ReturnInst::Create(F->getContext(), StubBB); // Just return void.
|
||||||
|
|
||||||
// Finally, return the value returned by our nullary stub function.
|
// Finally, call our nullary stub function.
|
||||||
return runFunction(Stub, std::vector<GenericValue>());
|
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) {
|
void JIT::RegisterJITEventListener(JITEventListener *L) {
|
||||||
|
|
Loading…
Reference in New Issue