File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
llvm/lib/ExecutionEngine/MCJIT Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 88
99#include " MCJIT.h"
1010#include " llvm/ADT/STLExtras.h"
11+ #include " llvm/CodeGen/MachineModuleInfo.h"
1112#include " llvm/ExecutionEngine/GenericValue.h"
1213#include " llvm/ExecutionEngine/JITEventListener.h"
1314#include " llvm/ExecutionEngine/MCJIT.h"
@@ -157,14 +158,17 @@ std::unique_ptr<MemoryBuffer> MCJIT::emitObject(Module *M) {
157158 // generateCodeForModule.
158159
159160 legacy::PassManager PM;
161+ auto * LLVMTM = static_cast <LLVMTargetMachine*>(TM.get ());
162+ MachineModuleInfo MMI (LLVMTM);
163+ Ctx = &MMI.getContext ();
160164
161165 // The RuntimeDyld will take ownership of this shortly
162166 SmallVector<char , 4096 > ObjBufferSV;
163167 raw_svector_ostream ObjStream (ObjBufferSV);
164168
165169 // Turn the machine code intermediate representation into bytes in memory
166170 // that may be executed.
167- if (TM ->addPassesToEmitMC (PM, Ctx , ObjStream, !getVerifyModules ()))
171+ if (LLVMTM ->addPassesToEmitMC (PM, MMI , ObjStream, !getVerifyModules ()))
168172 report_fatal_error (" Target does not support MC emission!" );
169173
170174 // Initialize passes.
You can’t perform that action at this time.
0 commit comments