From 63e1647827f3427c5f3ad37461d84a63ba5fcdaf Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 26 Jul 2024 13:10:08 +0400 Subject: CodeGen: Remove MachineModuleInfo reference from MachineFunction (#100357) 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. --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp') diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index f382df1..c664959 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -27,7 +27,6 @@ MachineModuleInfoImpl::~MachineModuleInfoImpl() = default; void MachineModuleInfo::initialize() { ObjFileMMI = nullptr; NextFnNum = 0; - DbgInfoAvailable = false; } void MachineModuleInfo::finalize() { @@ -87,7 +86,7 @@ MachineFunction &MachineModuleInfo::getOrCreateMachineFunction(Function &F) { if (I.second) { // No pre-existing machine function, create a new one. const TargetSubtargetInfo &STI = *TM.getSubtargetImpl(F); - MF = new MachineFunction(F, TM, STI, NextFnNum++, *this); + MF = new MachineFunction(F, TM, STI, getContext(), NextFnNum++); MF->initTargetMachineFunctionInfo(STI); // MRI callback for target specific initializations. @@ -207,7 +206,6 @@ bool MachineModuleInfoWrapperPass::doInitialization(Module &M) { Ctx.diagnose( DiagnosticInfoSrcMgr(SMD, M.getName(), IsInlineAsm, LocCookie)); }); - MMI.DbgInfoAvailable = !M.debug_compile_units().empty(); return false; } @@ -232,6 +230,5 @@ MachineModuleAnalysis::run(Module &M, ModuleAnalysisManager &) { Ctx.diagnose( DiagnosticInfoSrcMgr(SMD, M.getName(), IsInlineAsm, LocCookie)); }); - MMI.DbgInfoAvailable = !M.debug_compile_units().empty(); return Result(MMI); } -- cgit v1.1