Skip to content

Commit e8e81db

Browse files
committed
Migrated CompileUtils.cpp to the new LLVMTargetMachine code emission API.
1 parent 631cbb2 commit e8e81db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
1010

1111
#include "llvm/ADT/SmallVector.h"
12+
#include "llvm/CodeGen/MachineModuleInfo.h"
1213
#include "llvm/ExecutionEngine/ObjectCache.h"
1314
#include "llvm/IR/LegacyPassManager.h"
1415
#include "llvm/IR/Module.h"
@@ -46,8 +47,9 @@ Expected<SimpleCompiler::CompileResult> SimpleCompiler::operator()(Module &M) {
4647
raw_svector_ostream ObjStream(ObjBufferSV);
4748

4849
legacy::PassManager PM;
49-
MCContext *Ctx;
50-
if (TM.addPassesToEmitMC(PM, Ctx, ObjStream))
50+
auto *LLVMTM = static_cast<LLVMTargetMachine *>(&TM);
51+
MachineModuleInfo MMI(LLVMTM);
52+
if (LLVMTM->addPassesToEmitMC(PM, MMI, ObjStream))
5153
return make_error<StringError>("Target does not support MC emission",
5254
inconvertibleErrorCode());
5355
PM.run(M);

0 commit comments

Comments
 (0)