diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-05-20 17:24:08 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-05-20 17:24:08 +0000 |
commit | 6514551be704adb577682148ca825c08fd642329 (patch) | |
tree | eaba4495339d85991fac14581605452a6657d249 /tools | |
parent | 2e8e5c0eca6f34a94f92824fc713afd6dc329e25 (diff) |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lli/lli.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 7f7c37f50e..b6c9299c65 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -419,8 +419,6 @@ int main(int argc, char **argv, char * const *envp) { 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 @@ int main(int argc, char **argv, char * const *envp) { builder.setUseMCJIT(true); JMM = new LLIMCJITMemoryManager(); builder.setJITMemoryManager(JMM); + } else { + builder.setJITMemoryManager(ForceInterpreter ? 0 : + JITMemoryManager::CreateDefaultMemManager()); } CodeGenOpt::Level OLvl = CodeGenOpt::Default; |