void IntelJITEventListener::NotifyObjectEmitted(const ObjectImage &Obj) {
// Get the address of the object image for use as a unique identifier
const void* ObjData = Obj.getData().data();
- DIContext* Context = DIContext::getDWARFContext(Obj.getObjectFile());
+ DIContext* Context = DIContext::getDWARFContext(*Obj.getObjectFile());
MethodAddressVector Functions;
// Use symbol info to iterate functions in the object.
// 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;
// Compile the IR
std::string Error;
- TheJIT.reset(EngineBuilder(TheModule)
+ TheJIT.reset(EngineBuilder(std::move(TheModule))
.setEngineKind(EngineKind::JIT)
.setErrorStr(&Error)
.setJITMemoryManager(MemMgr)
}
LLVMContext Context; // Global ownership
- Module *TheModule; // Owned by ExecutionEngine.
JITMemoryManager *JMM; // Owned by ExecutionEngine.
std::unique_ptr<ExecutionEngine> TheJIT;
JITEventListenerTestBase(WrapperT* w)
: MockWrapper(w)
, M(new llvm::Module("module", llvm::getGlobalContext()))
- , EE(llvm::EngineBuilder(M)
+ , EE(llvm::EngineBuilder(std::unique_ptr<llvm::Module>(M))
.setEngineKind(llvm::EngineKind::JIT)
.setOptLevel(llvm::CodeGenOpt::None)
.create())