From 242978cdee04dbfb5c914c0fbbbe924cb8c60513 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Fri, 24 Oct 2003 03:55:37 +0000 Subject: [PATCH 1/1] 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 --- lib/ExecutionEngine/JIT/VM.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ExecutionEngine/JIT/VM.cpp b/lib/ExecutionEngine/JIT/VM.cpp index c6c2fdf2cf3..2dda271fa0a 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); -- 2.34.1