aboutsummaryrefslogtreecommitdiff
path: root/tools/lli/lli.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-01-11 21:12:51 +0000
committerJim Grosbach <grosbach@apple.com>2012-01-11 21:12:51 +0000
commitbf9ab932c1efea8804b3bc9d5b66314e6374d4cd (patch)
tree0d73b5ef53b284928bbdafb65a99792fe4d3e655 /tools/lli/lli.cpp
parentfae699a580380b910740e1cb17ab950ba91ce4a1 (diff)
lli should create a JIT memory manager.
Previously let the JITEmitter do it. That's rather odd, and doesn't play nice with the MCJIT, so move the (trivial) logic up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli/lli.cpp')
-rw-r--r--tools/lli/lli.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index f855eda195..b79925e926 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -23,6 +23,7 @@
#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
+#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/IRReader.h"
@@ -192,6 +193,8 @@ int main(int argc, char **argv, char * const *envp) {
}
}
+ JITMemoryManager *JMM = JITMemoryManager::CreateDefaultMemManager();
+
EngineBuilder builder(Mod);
builder.setMArch(MArch);
builder.setMCPU(MCPU);
@@ -199,6 +202,7 @@ int main(int argc, char **argv, char * const *envp) {
builder.setRelocationModel(RelocModel);
builder.setCodeModel(CMModel);
builder.setErrorStr(&ErrorMsg);
+ builder.setJITMemoryManager(JMM);
builder.setEngineKind(ForceInterpreter
? EngineKind::Interpreter
: EngineKind::JIT);