aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/JIT
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-10-24 03:55:37 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-10-24 03:55:37 +0000
commit242978cdee04dbfb5c914c0fbbbe924cb8c60513 (patch)
tree16a2904b1912187dbbd67d6dcf4a67fc1d413cf4 /lib/ExecutionEngine/JIT
parent45daa0ad94c1b83f03dbaf58d2afa3acfcb06466 (diff)
downloadexternal_llvm-242978cdee04dbfb5c914c0fbbbe924cb8c60513.zip
external_llvm-242978cdee04dbfb5c914c0fbbbe924cb8c60513.tar.gz
external_llvm-242978cdee04dbfb5c914c0fbbbe924cb8c60513.tar.bz2
Destroy MachineFunction for any Function that we are about to
recompile and relink. This keeps it from failing an assertion when it goes and tries to construct a new MachineFunction for that Function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT')
-rw-r--r--lib/ExecutionEngine/JIT/VM.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/JIT/VM.cpp b/lib/ExecutionEngine/JIT/VM.cpp
index c6c2fdf..2dda271 100644
--- a/lib/ExecutionEngine/JIT/VM.cpp
+++ b/lib/ExecutionEngine/JIT/VM.cpp
@@ -15,6 +15,7 @@
#include "VM.h"
#include "llvm/Function.h"
#include "llvm/ModuleProvider.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineCodeEmitter.h"
#include "llvm/Target/TargetMachine.h"
@@ -91,6 +92,7 @@ void *VM::recompileAndRelinkFunction(Function *F) {
void *OldAddr = Addr;
Addr = 0;
+ MachineFunction::destruct (F);
runJITOnFunction (F);
assert(Addr && "Code generation didn't add function to GlobalAddress table!");
TM.replaceMachineCodeForFunction (OldAddr, Addr);