diff options
| author | Jeffrey Yasskin <jyasskin@google.com> | 2010-02-12 23:05:31 +0000 |
|---|---|---|
| committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-02-12 23:05:31 +0000 |
| commit | 8f621bd428daf313dba419eed692e9f483379af4 (patch) | |
| tree | 6974ef847a1b72e8b7828358441dc84c0169761b /lib/ExecutionEngine | |
| parent | cc21920b8935fd3b813dbe1a13b2c1c567154a50 (diff) | |
| download | external_llvm-8f621bd428daf313dba419eed692e9f483379af4.zip external_llvm-8f621bd428daf313dba419eed692e9f483379af4.tar.gz external_llvm-8f621bd428daf313dba419eed692e9f483379af4.tar.bz2 | |
Make JIT::runFunction clean up the generated stub function.
Patch by Shivram K!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
| -rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 59a9a3d..3684a27 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -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) { |
