Skip to content

Commit 284f0ef

Browse files
committed
CodeGen: Remove MachineModuleInfo reference from MachineFunction
This avoids another unserializable field. Move the DbgInfoAvailable field into the AsmPrinter, which is only really a cache/convenience bit for checking a direct IR module metadata check.
1 parent 1e3fdb2 commit 284f0ef

22 files changed

+57
-63
lines changed

llvm/include/llvm/CodeGen/AsmPrinter.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ class AsmPrinter : public MachineFunctionPass {
225225
/// split stack prologue.
226226
bool HasNoSplitStack = false;
227227

228+
/// True if debugging information is available in this module.
229+
bool DbgInfoAvailable = false;
230+
228231
protected:
229232
explicit AsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer);
230233

@@ -430,6 +433,9 @@ class AsmPrinter : public MachineFunctionPass {
430433
/// Get the CFISection type for the module.
431434
CFISection getModuleCFISectionType() const { return ModuleCFISection; }
432435

436+
/// Returns true if valid debug info is present.
437+
bool hasDebugInfo() const { return DbgInfoAvailable; }
438+
433439
bool needsSEHMoves();
434440

435441
/// Since emitting CFI unwind information is entangled with supporting the

llvm/include/llvm/CodeGen/MachineFunction.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction {
260260
const LLVMTargetMachine &Target;
261261
const TargetSubtargetInfo *STI;
262262
MCContext &Ctx;
263-
MachineModuleInfo &MMI;
264263

265264
// RegInfo - Information about each register in use in the function.
266265
MachineRegisterInfo *RegInfo;
@@ -395,15 +394,15 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction {
395394

396395
/// \}
397396

398-
/// Clear all the members of this MachineFunction, but the ones used
399-
/// to initialize again the MachineFunction.
400-
/// More specifically, this deallocates all the dynamically allocated
401-
/// objects and get rid of all the XXXInfo data structure, but keep
402-
/// unchanged the references to Fn, Target, MMI, and FunctionNumber.
397+
/// Clear all the members of this MachineFunction, but the ones used to
398+
/// initialize again the MachineFunction. More specifically, this deallocates
399+
/// all the dynamically allocated objects and get rid of all the XXXInfo data
400+
/// structure, but keep unchanged the references to Fn, Target, and
401+
/// FunctionNumber.
403402
void clear();
404403
/// Allocate and initialize the different members.
405404
/// In particular, the XXXInfo data structure.
406-
/// \pre Fn, Target, MMI, and FunctionNumber are properly set.
405+
/// \pre Fn, Target, and FunctionNumber are properly set.
407406
void init();
408407

409408
public:
@@ -632,8 +631,8 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction {
632631
const static unsigned int DebugOperandMemNumber;
633632

634633
MachineFunction(Function &F, const LLVMTargetMachine &Target,
635-
const TargetSubtargetInfo &STI, unsigned FunctionNum,
636-
MachineModuleInfo &MMI);
634+
const TargetSubtargetInfo &STI, MCContext &Ctx,
635+
unsigned FunctionNum);
637636
MachineFunction(const MachineFunction &) = delete;
638637
MachineFunction &operator=(const MachineFunction &) = delete;
639638
~MachineFunction();
@@ -665,7 +664,6 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction {
665664

666665
GISelChangeObserver *getObserver() const { return Observer; }
667666

668-
MachineModuleInfo &getMMI() const { return MMI; }
669667
MCContext &getContext() const { return Ctx; }
670668

671669
/// Returns the Section this function belongs to.

llvm/include/llvm/CodeGen/MachineModuleInfo.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ class MachineModuleInfo {
113113
// -g. At this moment, there's no way to specify that some CFI directives
114114
// go into .eh_frame only, while others go into .debug_frame only.
115115

116-
/// True if debugging information is available in this module.
117-
bool DbgInfoAvailable = false;
118-
119116
/// True if this module is being built for windows/msvc, and uses floating
120117
/// point. This is used to emit an undefined reference to _fltused.
121118
bool UsesMSVCFloatingPoint = false;
@@ -186,9 +183,6 @@ class MachineModuleInfo {
186183
return const_cast<MachineModuleInfo*>(this)->getObjFileInfo<Ty>();
187184
}
188185

189-
/// Returns true if valid debug info is present.
190-
bool hasDebugInfo() const { return DbgInfoAvailable; }
191-
192186
bool usesMSVCFloatingPoint() const { return UsesMSVCFloatingPoint; }
193187

194188
void setUsesMSVCFloatingPoint(bool b) { UsesMSVCFloatingPoint = b; }

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ bool AsmPrinter::doInitialization(Module &M) {
436436
MMI = MMIWP ? &MMIWP->getMMI() : nullptr;
437437
HasSplitStack = false;
438438
HasNoSplitStack = false;
439+
DbgInfoAvailable = !M.debug_compile_units().empty();
439440

440441
AddrLabelSymbols = nullptr;
441442

@@ -541,8 +542,7 @@ bool AsmPrinter::doInitialization(Module &M) {
541542
if (EmitCodeView && TM.getTargetTriple().isOSWindows())
542543
DebugHandlers.push_back(std::make_unique<CodeViewDebug>(this));
543544
if (!EmitCodeView || M.getDwarfVersion()) {
544-
assert(MMI && "MMI could not be nullptr here!");
545-
if (MMI->hasDebugInfo()) {
545+
if (hasDebugInfo()) {
546546
DD = new DwarfDebug(this);
547547
DebugHandlers.push_back(std::unique_ptr<DwarfDebug>(DD));
548548
}
@@ -1278,7 +1278,7 @@ AsmPrinter::getFunctionCFISectionType(const Function &F) const {
12781278
return CFISection::EH;
12791279

12801280
assert(MMI != nullptr && "Invalid machine module info");
1281-
if (MMI->hasDebugInfo() || TM.Options.ForceDwarfFrameSection)
1281+
if (hasDebugInfo() || TM.Options.ForceDwarfFrameSection)
12821282
return CFISection::Debug;
12831283

12841284
return CFISection::None;
@@ -1669,11 +1669,10 @@ void AsmPrinter::emitPCSections(const MachineFunction &MF) {
16691669
}
16701670

16711671
/// Returns true if function begin and end labels should be emitted.
1672-
static bool needFuncLabels(const MachineFunction &MF,
1673-
const MachineModuleInfo &MMI) {
1672+
static bool needFuncLabels(const MachineFunction &MF, const AsmPrinter &Asm) {
16741673
if (!MF.getLandingPads().empty() || MF.hasEHFunclets() ||
1675-
MMI.hasDebugInfo() ||
1676-
MF.getFunction().hasMetadata(LLVMContext::MD_pcsections))
1674+
MF.getFunction().hasMetadata(LLVMContext::MD_pcsections) ||
1675+
Asm.hasDebugInfo())
16771676
return true;
16781677

16791678
// We might emit an EH table that uses function begin and end labels even if
@@ -1944,7 +1943,7 @@ void AsmPrinter::emitFunctionBody() {
19441943
// are automatically sized.
19451944
bool EmitFunctionSize = MAI->hasDotTypeDotSizeDirective() && !TT.isWasm();
19461945

1947-
if (needFuncLabels(*MF, *MMI) || EmitFunctionSize) {
1946+
if (EmitFunctionSize || needFuncLabels(*MF, *this)) {
19481947
// Create a symbol for the end of function.
19491948
CurrentFnEnd = createTempSymbol("func_end");
19501949
OutStreamer->emitLabel(CurrentFnEnd);
@@ -2588,7 +2587,7 @@ void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
25882587
if (F.hasFnAttribute("patchable-function-entry") ||
25892588
F.hasFnAttribute("function-instrument") ||
25902589
F.hasFnAttribute("xray-instruction-threshold") ||
2591-
needFuncLabels(MF, *MMI) || NeedsLocalForSize ||
2590+
needFuncLabels(MF, *this) || NeedsLocalForSize ||
25922591
MF.getTarget().Options.EmitStackSizeSection ||
25932592
MF.getTarget().Options.BBAddrMap || MF.hasBBLabels()) {
25942593
CurrentFnBegin = createTempSymbol("func_begin");

llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ static SourceLanguage MapDWLangToCVLang(unsigned DWLang) {
613613
void CodeViewDebug::beginModule(Module *M) {
614614
// If module doesn't have named metadata anchors or COFF debug section
615615
// is not available, skip any debug info related stuff.
616-
if (!MMI->hasDebugInfo() ||
616+
if (!Asm->hasDebugInfo() ||
617617
!Asm->getObjFileLowering().getCOFFDebugSymbolsSection()) {
618618
Asm = nullptr;
619619
return;
@@ -636,7 +636,7 @@ void CodeViewDebug::beginModule(Module *M) {
636636
}
637637

638638
void CodeViewDebug::endModule() {
639-
if (!Asm || !MMI->hasDebugInfo())
639+
if (!Asm || !Asm->hasDebugInfo())
640640
return;
641641

642642
// The COFF .debug$S section consists of several subsections, each starting

llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ void DebugHandlerBase::beginFunction(const MachineFunction *MF) {
351351
}
352352

353353
void DebugHandlerBase::beginInstruction(const MachineInstr *MI) {
354-
if (!Asm || !MMI->hasDebugInfo())
354+
if (!Asm || !Asm->hasDebugInfo())
355355
return;
356356

357357
assert(CurMI == nullptr);
@@ -377,7 +377,7 @@ void DebugHandlerBase::beginInstruction(const MachineInstr *MI) {
377377
}
378378

379379
void DebugHandlerBase::endInstruction() {
380-
if (!Asm || !MMI->hasDebugInfo())
380+
if (!Asm || !Asm->hasDebugInfo())
381381
return;
382382

383383
assert(CurMI != nullptr);

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ void DwarfDebug::endModule() {
14341434

14351435
// If we aren't actually generating debug info (check beginModule -
14361436
// conditionalized on the presence of the llvm.dbg.cu metadata node)
1437-
if (!Asm || !MMI->hasDebugInfo())
1437+
if (!Asm || !Asm->hasDebugInfo())
14381438
return;
14391439

14401440
// Finalize the debug info for the module.

llvm/lib/CodeGen/MachineFunction.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ static inline Align getFnStackAlignment(const TargetSubtargetInfo *STI,
162162
}
163163

164164
MachineFunction::MachineFunction(Function &F, const LLVMTargetMachine &Target,
165-
const TargetSubtargetInfo &STI,
166-
unsigned FunctionNum, MachineModuleInfo &mmi)
167-
: F(F), Target(Target), STI(&STI), Ctx(mmi.getContext()), MMI(mmi) {
165+
const TargetSubtargetInfo &STI, MCContext &Ctx,
166+
unsigned FunctionNum)
167+
: F(F), Target(Target), STI(&STI), Ctx(Ctx) {
168168
FunctionNumber = FunctionNum;
169169
init();
170170
}
@@ -654,9 +654,9 @@ void MachineFunction::print(raw_ostream &OS, const SlotIndexes *Indexes) const {
654654

655655
/// True if this function needs frame moves for debug or exceptions.
656656
bool MachineFunction::needsFrameMoves() const {
657-
return getMMI().hasDebugInfo() ||
658-
getTarget().Options.ForceDwarfFrameSection ||
659-
F.needsUnwindTableEntry();
657+
return getTarget().Options.ForceDwarfFrameSection ||
658+
F.needsUnwindTableEntry() ||
659+
!F.getParent()->debug_compile_units().empty();
660660
}
661661

662662
namespace llvm {

llvm/lib/CodeGen/MachineFunctionAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MachineFunctionAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
3737
.getCachedResult<MachineModuleAnalysis>(*F.getParent())
3838
->getMMI();
3939
auto MF = std::make_unique<MachineFunction>(
40-
F, *TM, STI, Context.generateMachineFunctionNum(F), MMI);
40+
F, *TM, STI, MMI.getContext(), Context.generateMachineFunctionNum(F));
4141
MF->initTargetMachineFunctionInfo(STI);
4242

4343
// MRI callback for target specific initializations.

llvm/lib/CodeGen/MachineModuleInfo.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ void MachineModuleInfo::initialize() {
3939
CurCallSite = 0;
4040
NextFnNum = 0;
4141
UsesMSVCFloatingPoint = false;
42-
DbgInfoAvailable = false;
4342
}
4443

4544
void MachineModuleInfo::finalize() {
@@ -100,7 +99,7 @@ MachineFunction &MachineModuleInfo::getOrCreateMachineFunction(Function &F) {
10099
if (I.second) {
101100
// No pre-existing machine function, create a new one.
102101
const TargetSubtargetInfo &STI = *TM.getSubtargetImpl(F);
103-
MF = new MachineFunction(F, TM, STI, NextFnNum++, *this);
102+
MF = new MachineFunction(F, TM, STI, getContext(), NextFnNum++);
104103
MF->initTargetMachineFunctionInfo(STI);
105104

106105
// MRI callback for target specific initializations.
@@ -220,7 +219,6 @@ bool MachineModuleInfoWrapperPass::doInitialization(Module &M) {
220219
Ctx.diagnose(
221220
DiagnosticInfoSrcMgr(SMD, M.getName(), IsInlineAsm, LocCookie));
222221
});
223-
MMI.DbgInfoAvailable = !M.debug_compile_units().empty();
224222
return false;
225223
}
226224

@@ -245,6 +243,5 @@ MachineModuleAnalysis::run(Module &M, ModuleAnalysisManager &) {
245243
Ctx.diagnose(
246244
DiagnosticInfoSrcMgr(SMD, M.getName(), IsInlineAsm, LocCookie));
247245
});
248-
MMI.DbgInfoAvailable = !M.debug_compile_units().empty();
249246
return Result(MMI);
250247
}

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8619,21 +8619,21 @@ SDValue SelectionDAGBuilder::lowerStartEH(SDValue Chain,
86198619
const BasicBlock *EHPadBB,
86208620
MCSymbol *&BeginLabel) {
86218621
MachineFunction &MF = DAG.getMachineFunction();
8622-
MachineModuleInfo &MMI = MF.getMMI();
8622+
MachineModuleInfo *MMI = DAG.getMMI();
86238623

86248624
// Insert a label before the invoke call to mark the try range. This can be
86258625
// used to detect deletion of the invoke via the MachineModuleInfo.
86268626
BeginLabel = MF.getContext().createTempSymbol();
86278627

86288628
// For SjLj, keep track of which landing pads go with which invokes
86298629
// so as to maintain the ordering of pads in the LSDA.
8630-
unsigned CallSiteIndex = MMI.getCurrentCallSite();
8630+
unsigned CallSiteIndex = MMI->getCurrentCallSite();
86318631
if (CallSiteIndex) {
86328632
MF.setCallSiteBeginLabel(BeginLabel, CallSiteIndex);
86338633
LPadToCallSiteMap[FuncInfo.MBBMap[EHPadBB]].push_back(CallSiteIndex);
86348634

86358635
// Now that the call site is handled, stop tracking it.
8636-
MMI.setCurrentCallSite(0);
8636+
MMI->setCurrentCallSite(0);
86378637
}
86388638

86398639
return DAG.getEHLabel(getCurSDLoc(), Chain, BeginLabel);

llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,6 @@ void NVPTXAsmPrinter::emitHeader(Module &M, raw_ostream &O,
928928
}
929929

930930
bool NVPTXAsmPrinter::doFinalization(Module &M) {
931-
bool HasDebugInfo = MMI && MMI->hasDebugInfo();
932-
933931
// If we did not emit any functions, then the global declarations have not
934932
// yet been emitted.
935933
if (!GlobalsEmitted) {
@@ -945,7 +943,7 @@ bool NVPTXAsmPrinter::doFinalization(Module &M) {
945943
auto *TS =
946944
static_cast<NVPTXTargetStreamer *>(OutStreamer->getTargetStreamer());
947945
// Close the last emitted section
948-
if (HasDebugInfo) {
946+
if (hasDebugInfo()) {
949947
TS->closeLastSection();
950948
// Emit empty .debug_loc section for better support of the empty files.
951949
OutStreamer->emitRawText("\t.section\t.debug_loc\t{\t}");

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3137,11 +3137,11 @@ void PPCAIXAsmPrinter::emitInstruction(const MachineInstr *MI) {
31373137
break;
31383138
MCSymbol *TempSym = OutContext.createNamedTempSymbol();
31393139
OutStreamer->emitLabel(TempSym);
3140-
OutStreamer->emitXCOFFExceptDirective(CurrentFnSym, TempSym,
3141-
LangMO.getImm(), ReasonMO.getImm(),
3142-
Subtarget->isPPC64() ? MI->getMF()->getInstructionCount() * 8 :
3143-
MI->getMF()->getInstructionCount() * 4,
3144-
MMI->hasDebugInfo());
3140+
OutStreamer->emitXCOFFExceptDirective(
3141+
CurrentFnSym, TempSym, LangMO.getImm(), ReasonMO.getImm(),
3142+
Subtarget->isPPC64() ? MI->getMF()->getInstructionCount() * 8
3143+
: MI->getMF()->getInstructionCount() * 4,
3144+
hasDebugInfo());
31453145
break;
31463146
}
31473147
case PPC::GETtlsMOD32AIX:
@@ -3199,7 +3199,7 @@ void PPCAIXAsmPrinter::emitInstruction(const MachineInstr *MI) {
31993199

32003200
bool PPCAIXAsmPrinter::doFinalization(Module &M) {
32013201
// Do streamer related finalization for DWARF.
3202-
if (!MAI->usesDwarfFileAndLocDirectives() && MMI->hasDebugInfo())
3202+
if (!MAI->usesDwarfFileAndLocDirectives() && hasDebugInfo())
32033203
OutStreamer->doFinalizationAtSectionEnd(
32043204
OutStreamer->getContext().getObjectFileInfo()->getTextSection());
32053205

llvm/tools/llvm-reduce/ReducerWorkItem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static std::unique_ptr<MachineFunction> cloneMF(MachineFunction *SrcMF,
232232
MachineModuleInfo &DestMMI) {
233233
auto DstMF = std::make_unique<MachineFunction>(
234234
SrcMF->getFunction(), SrcMF->getTarget(), SrcMF->getSubtarget(),
235-
SrcMF->getFunctionNumber(), DestMMI);
235+
SrcMF->getContext(), SrcMF->getFunctionNumber());
236236
DenseMap<MachineBasicBlock *, MachineBasicBlock *> Src2DstMBB;
237237

238238
auto *SrcMRI = &SrcMF->getRegInfo();

llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class AArch64SelectionDAGTest : public testing::Test {
6161

6262
MachineModuleInfo MMI(TM.get());
6363

64-
MF = std::make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F), 0,
65-
MMI);
64+
MF = std::make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F),
65+
MMI.getContext(), 0);
6666

6767
DAG = std::make_unique<SelectionDAG>(*TM, CodeGenOptLevel::None);
6868
if (!DAG)

llvm/unittests/CodeGen/InstrRefLDVTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class InstrRefLDVTest : public testing::Test {
9494
const TargetSubtargetInfo &STI = *Machine->getSubtargetImpl(*F);
9595

9696
MF = std::make_unique<MachineFunction>(*F, (LLVMTargetMachine &)*Machine,
97-
STI, FunctionNum, *MMI);
97+
STI, MMI->getContext(), FunctionNum);
9898

9999
// Create metadata: CU, subprogram, some blocks and an inline function
100100
// scope.

llvm/unittests/CodeGen/MFCommon.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ std::unique_ptr<MachineFunction> createMachineFunction(LLVMContext &Ctx,
135135
MachineModuleInfo MMI(TM);
136136
const TargetSubtargetInfo &STI = *TM->getSubtargetImpl(*F);
137137

138-
return std::make_unique<MachineFunction>(*F, *TM, STI, FunctionNum, MMI);
138+
return std::make_unique<MachineFunction>(*F, *TM, STI, MMI.getContext(),
139+
FunctionNum);
139140
}
140141

llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class SelectionDAGAddressAnalysisTest : public testing::Test {
7272
MachineModuleInfo MMI(TM.get());
7373

7474
MF = std::make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F),
75-
0, MMI);
75+
MMI.getContext(), 0);
7676

7777
DAG = std::make_unique<SelectionDAG>(*TM, CodeGenOptLevel::None);
7878
if (!DAG)

llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class SelectionDAGPatternMatchTest : public testing::Test {
7171
MachineModuleInfo MMI(TM.get());
7272

7373
MF = std::make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F),
74-
0, MMI);
74+
MMI.getContext(), 0);
7575

7676
DAG = std::make_unique<SelectionDAG>(*TM, CodeGenOptLevel::None);
7777
if (!DAG)

llvm/unittests/Target/AMDGPU/ExecMayBeModifiedBeforeAnyUse.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ TEST(AMDGPU, ExecMayBeModifiedBeforeAnyUse) {
2929
auto *F = Function::Create(Type, GlobalValue::ExternalLinkage, "Test", &Mod);
3030

3131
MachineModuleInfo MMI(TM.get());
32-
auto MF = std::make_unique<MachineFunction>(*F, *TM, ST, 42, MMI);
32+
auto MF =
33+
std::make_unique<MachineFunction>(*F, *TM, ST, MMI.getContext(), 42);
3334
auto *BB = MF->CreateMachineBasicBlock();
3435
MF->push_back(BB);
3536

0 commit comments

Comments
 (0)