Destroy MachineFunction for any Function that we are about to
authorBrian Gaeke <gaeke@uiuc.edu>
Fri, 24 Oct 2003 03:55:37 +0000 (03:55 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Fri, 24 Oct 2003 03:55:37 +0000 (03:55 +0000)
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

lib/ExecutionEngine/JIT/VM.cpp

index c6c2fdf2cf3cfd12aebd6f2157aedc6be38203c5..2dda271fa0ad4018dd9c1063abba428eabda2a7b 100644 (file)
@@ -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);