[llvm-commits] [llvm] r157160 - in /llvm/trunk: lib/CodeGen/LLVMTargetMachine.cpp tools/lli/lli.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sun May 20 10:24:08 PDT 2012
Author: d0k
Date: Sun May 20 12:24:08 2012
New Revision: 157160
URL: http://llvm.org/viewvc/llvm-project?rev=157160&view=rev
Log:
Plug a leak when using MCJIT.
Found by valgrind.
Modified:
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
llvm/trunk/tools/lli/lli.cpp
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=157160&r1=157159&r2=157160&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Sun May 20 12:24:08 2012
@@ -273,7 +273,7 @@
// Create the code emitter for the target if it exists. If not, .o file
// emission fails.
- const MCRegisterInfo &MRI = *getTarget().createMCRegInfo(getTargetTriple());
+ const MCRegisterInfo &MRI = *getRegisterInfo();
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(*getInstrInfo(), MRI,
STI, *Ctx);
Modified: llvm/trunk/tools/lli/lli.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/lli.cpp?rev=157160&r1=157159&r2=157160&view=diff
==============================================================================
--- llvm/trunk/tools/lli/lli.cpp (original)
+++ llvm/trunk/tools/lli/lli.cpp Sun May 20 12:24:08 2012
@@ -419,8 +419,6 @@
builder.setRelocationModel(RelocModel);
builder.setCodeModel(CMModel);
builder.setErrorStr(&ErrorMsg);
- builder.setJITMemoryManager(ForceInterpreter ? 0 :
- JITMemoryManager::CreateDefaultMemManager());
builder.setEngineKind(ForceInterpreter
? EngineKind::Interpreter
: EngineKind::JIT);
@@ -435,6 +433,9 @@
builder.setUseMCJIT(true);
JMM = new LLIMCJITMemoryManager();
builder.setJITMemoryManager(JMM);
+ } else {
+ builder.setJITMemoryManager(ForceInterpreter ? 0 :
+ JITMemoryManager::CreateDefaultMemManager());
}
CodeGenOpt::Level OLvl = CodeGenOpt::Default;
More information about the llvm-commits
mailing list