From 98b618270a172bf7225dfa37e782b27f2fe86de3 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Fri, 24 Oct 2003 03:55:37 +0000 Subject: 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. llvm-svn: 9459 --- llvm/lib/ExecutionEngine/JIT/VM.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/ExecutionEngine/JIT/VM.cpp') diff --git a/llvm/lib/ExecutionEngine/JIT/VM.cpp b/llvm/lib/ExecutionEngine/JIT/VM.cpp index c6c2fdf2cf3..2dda271fa0a 100644 --- a/llvm/lib/ExecutionEngine/JIT/VM.cpp +++ b/llvm/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); -- cgit v1.2.3