MIR Parser: wrap 'MBBSlots' from the MI parsing functions in a struct. NFC.
[oota-llvm.git] / tools / llvm-jitlistener / llvm-jitlistener.cpp
index 1053ad9ab66142f662de402fc976b5c69d0ce6ce..af1a59bdbd377298a650ec10bffecd70e1521501 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/IR/LLVMContext.h"
 #include "../../lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/ExecutionEngine/JITEventListener.h"
-#include "llvm/ExecutionEngine/SectionMemoryManager.h"
 #include "llvm/ExecutionEngine/MCJIT.h"
-#include "llvm/ExecutionEngine/ObjectImage.h"
+#include "llvm/ExecutionEngine/SectionMemoryManager.h"
+#include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IRReader/IRReader.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
 #include "llvm/Support/Host.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/MemoryBuffer.h"
@@ -30,6 +30,7 @@
 #include "llvm/Support/Signals.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/TargetSelect.h"
+#include "llvm/Support/raw_ostream.h"
 #include <string>
 
 using namespace llvm;
@@ -119,10 +120,6 @@ protected:
       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.
     RTDyldMemoryManager *MemMgr = new SectionMemoryManager();
     if (!MemMgr) {
       errs() << "Unable to create memory manager.";
@@ -144,7 +141,7 @@ protected:
     TheJIT.reset(EngineBuilder(std::move(TheModule))
       .setEngineKind(EngineKind::JIT)
       .setErrorStr(&Error)
-      .setMCJITMemoryManager(MemMgr)
+      .setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager>(MemMgr))
       .create());
     if (Error.empty() == false)
       errs() << Error;
@@ -155,7 +152,6 @@ protected:
   }
 
   LLVMContext Context; // Global ownership
-  JITMemoryManager *JMM; // Owned by ExecutionEngine.
   std::unique_ptr<ExecutionEngine> TheJIT;
 
 public: