llvm.org GIT mirror llvm / 6623af7
IntelJITEventListener updates to fix breaks by recent changes to EngineBuilder and DIContext. By Arch Robison. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216159 91177308-0d34-0410-b5e6-96231b3b80d8 Elena Demikhovsky 6 years ago
3 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
189189 void IntelJITEventListener::NotifyObjectEmitted(const ObjectImage &Obj) {
190190 // Get the address of the object image for use as a unique identifier
191191 const void* ObjData = Obj.getData().data();
192 DIContext* Context = DIContext::getDWARFContext(Obj.getObjectFile());
192 DIContext* Context = DIContext::getDWARFContext(*Obj.getObjectFile());
193193 MethodAddressVector Functions;
194194
195195 // Use symbol info to iterate functions in the object.
112112
113113 // Parse the bitcode...
114114 SMDiagnostic Err;
115 TheModule = ParseIRFile(IRFile, Err, Context);
115 std::unique_ptr TheModule(ParseIRFile(IRFile, Err, Context));
116116 if (!TheModule) {
117117 errs() << Err.getMessage();
118118 return;
144144
145145 // Compile the IR
146146 std::string Error;
147 TheJIT.reset(EngineBuilder(TheModule)
147 TheJIT.reset(EngineBuilder(std::move(TheModule))
148148 .setEngineKind(EngineKind::JIT)
149149 .setErrorStr(&Error)
150150 .setJITMemoryManager(MemMgr)
159159 }
160160
161161 LLVMContext Context; // Global ownership
162 Module *TheModule; // Owned by ExecutionEngine.
163162 JITMemoryManager *JMM; // Owned by ExecutionEngine.
164163 std::unique_ptr TheJIT;
165164
6565 JITEventListenerTestBase(WrapperT* w)
6666 : MockWrapper(w)
6767 , M(new llvm::Module("module", llvm::getGlobalContext()))
68 , EE(llvm::EngineBuilder(M)
68 , EE(llvm::EngineBuilder(std::unique_ptr(M))
6969 .setEngineKind(llvm::EngineKind::JIT)
7070 .setOptLevel(llvm::CodeGenOpt::None)
7171 .create())