aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-jitlistener
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-12-01 14:51:49 -0800
committerStephen Hines <srhines@google.com>2014-12-02 16:08:10 -0800
commit37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch)
tree8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /tools/llvm-jitlistener
parentd2327b22152ced7bc46dc629fc908959e8a52d03 (diff)
downloadexternal_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip
external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz
external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'tools/llvm-jitlistener')
-rw-r--r--tools/llvm-jitlistener/CMakeLists.txt43
-rw-r--r--tools/llvm-jitlistener/LLVMBuild.txt2
-rw-r--r--tools/llvm-jitlistener/Makefile2
-rw-r--r--tools/llvm-jitlistener/llvm-jitlistener.cpp21
4 files changed, 28 insertions, 40 deletions
diff --git a/tools/llvm-jitlistener/CMakeLists.txt b/tools/llvm-jitlistener/CMakeLists.txt
index c9704fb..68a4303 100644
--- a/tools/llvm-jitlistener/CMakeLists.txt
+++ b/tools/llvm-jitlistener/CMakeLists.txt
@@ -1,22 +1,21 @@
-# This tool is excluded from the CMake build if Intel JIT events are disabled.
-
-link_directories( ${LLVM_INTEL_JITEVENTS_LIBDIR} )
-include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} )
-
-set(LLVM_LINK_COMPONENTS
- asmparser
- bitreader
- debuginfo
- inteljitevents
- interpreter
- irreader
- jit
- mcjit
- nativecodegen
- object
- selectiondag
- )
-
-add_llvm_tool(llvm-jitlistener
- llvm-jitlistener.cpp
- )
+# This tool is excluded from the CMake build if Intel JIT events are disabled.
+
+link_directories( ${LLVM_INTEL_JITEVENTS_LIBDIR} )
+include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} )
+
+set(LLVM_LINK_COMPONENTS
+ asmparser
+ bitreader
+ debuginfo
+ inteljitevents
+ interpreter
+ irreader
+ mcjit
+ nativecodegen
+ object
+ selectiondag
+ )
+
+add_llvm_tool(llvm-jitlistener
+ llvm-jitlistener.cpp
+ )
diff --git a/tools/llvm-jitlistener/LLVMBuild.txt b/tools/llvm-jitlistener/LLVMBuild.txt
index 1ce78ac..e6ed20b 100644
--- a/tools/llvm-jitlistener/LLVMBuild.txt
+++ b/tools/llvm-jitlistener/LLVMBuild.txt
@@ -19,4 +19,4 @@
type = Tool
name = llvm-jitlistener
parent = Tools
-required_libraries = AsmParser BitReader IRReader Interpreter JIT MCJIT NativeCodeGen Object SelectionDAG Native
+required_libraries = AsmParser BitReader IRReader Interpreter MCJIT NativeCodeGen Object SelectionDAG Native
diff --git a/tools/llvm-jitlistener/Makefile b/tools/llvm-jitlistener/Makefile
index b132227..6d72427 100644
--- a/tools/llvm-jitlistener/Makefile
+++ b/tools/llvm-jitlistener/Makefile
@@ -12,7 +12,7 @@ TOOLNAME := llvm-jitlistener
include $(LEVEL)/Makefile.config
-LINK_COMPONENTS := mcjit jit interpreter nativecodegen bitreader asmparser irreader selectiondag Object
+LINK_COMPONENTS := mcjit interpreter nativecodegen bitreader asmparser irreader selectiondag Object
# If Intel JIT Events support is configured, link against the LLVM Intel JIT
# Events interface library. If not, this tool will do nothing useful, but it
diff --git a/tools/llvm-jitlistener/llvm-jitlistener.cpp b/tools/llvm-jitlistener/llvm-jitlistener.cpp
index c159aa5..0bb6e8b 100644
--- a/tools/llvm-jitlistener/llvm-jitlistener.cpp
+++ b/tools/llvm-jitlistener/llvm-jitlistener.cpp
@@ -17,7 +17,7 @@
#include "../../lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
-#include "llvm/ExecutionEngine/JITMemoryManager.h"
+#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/ObjectImage.h"
#include "llvm/IR/Module.h"
@@ -113,26 +113,18 @@ protected:
// Parse the bitcode...
SMDiagnostic Err;
- TheModule = ParseIRFile(IRFile, Err, Context);
+ std::unique_ptr<Module> TheModule(parseIRFile(IRFile, Err, Context));
if (!TheModule) {
errs() << Err.getMessage();
return;
}
- // FIXME: This is using the default legacy JITMemoryManager because it
- // supports poison memory. At some point, we'll need to update this to
- // use an MCJIT-specific memory manager. It might be nice to have the
- // poison memory option there too.
- JITMemoryManager *MemMgr = JITMemoryManager::CreateDefaultMemManager();
+ RTDyldMemoryManager *MemMgr = new SectionMemoryManager();
if (!MemMgr) {
errs() << "Unable to create memory manager.";
return;
}
- // Tell the memory manager to poison freed memory so that accessing freed
- // memory is more easily tested.
- MemMgr->setPoisonMemory(true);
-
// Override the triple to generate ELF on Windows since that's supported
Triple Tuple(TheModule->getTargetTriple());
if (Tuple.getTriple().empty())
@@ -145,11 +137,10 @@ protected:
// Compile the IR
std::string Error;
- TheJIT.reset(EngineBuilder(TheModule)
+ TheJIT.reset(EngineBuilder(std::move(TheModule))
.setEngineKind(EngineKind::JIT)
.setErrorStr(&Error)
- .setJITMemoryManager(MemMgr)
- .setUseMCJIT(true)
+ .setMCJITMemoryManager(MemMgr)
.create());
if (Error.empty() == false)
errs() << Error;
@@ -160,8 +151,6 @@ protected:
}
LLVMContext Context; // Global ownership
- Module *TheModule; // Owned by ExecutionEngine.
- JITMemoryManager *JMM; // Owned by ExecutionEngine.
std::unique_ptr<ExecutionEngine> TheJIT;
public: