mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 17:34:41 +00:00
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
This commit is contained in:
parent
45daa0ad94
commit
242978cdee
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user