mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 23:31:37 +00:00
Plug a leak when using MCJIT.
Found by valgrind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157160 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2e8e5c0eca
commit
6514551be7
@ -273,7 +273,7 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM,
|
|||||||
|
|
||||||
// Create the code emitter for the target if it exists. If not, .o file
|
// Create the code emitter for the target if it exists. If not, .o file
|
||||||
// emission fails.
|
// emission fails.
|
||||||
const MCRegisterInfo &MRI = *getTarget().createMCRegInfo(getTargetTriple());
|
const MCRegisterInfo &MRI = *getRegisterInfo();
|
||||||
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
||||||
MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(*getInstrInfo(), MRI,
|
MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(*getInstrInfo(), MRI,
|
||||||
STI, *Ctx);
|
STI, *Ctx);
|
||||||
|
@ -419,8 +419,6 @@ int main(int argc, char **argv, char * const *envp) {
|
|||||||
builder.setRelocationModel(RelocModel);
|
builder.setRelocationModel(RelocModel);
|
||||||
builder.setCodeModel(CMModel);
|
builder.setCodeModel(CMModel);
|
||||||
builder.setErrorStr(&ErrorMsg);
|
builder.setErrorStr(&ErrorMsg);
|
||||||
builder.setJITMemoryManager(ForceInterpreter ? 0 :
|
|
||||||
JITMemoryManager::CreateDefaultMemManager());
|
|
||||||
builder.setEngineKind(ForceInterpreter
|
builder.setEngineKind(ForceInterpreter
|
||||||
? EngineKind::Interpreter
|
? EngineKind::Interpreter
|
||||||
: EngineKind::JIT);
|
: EngineKind::JIT);
|
||||||
@ -435,6 +433,9 @@ int main(int argc, char **argv, char * const *envp) {
|
|||||||
builder.setUseMCJIT(true);
|
builder.setUseMCJIT(true);
|
||||||
JMM = new LLIMCJITMemoryManager();
|
JMM = new LLIMCJITMemoryManager();
|
||||||
builder.setJITMemoryManager(JMM);
|
builder.setJITMemoryManager(JMM);
|
||||||
|
} else {
|
||||||
|
builder.setJITMemoryManager(ForceInterpreter ? 0 :
|
||||||
|
JITMemoryManager::CreateDefaultMemManager());
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeGenOpt::Level OLvl = CodeGenOpt::Default;
|
CodeGenOpt::Level OLvl = CodeGenOpt::Default;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user