aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MIRPrinter.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2024-07-24 12:27:00 +0400
committerGitHub <noreply@github.com>2024-07-24 12:27:00 +0400
commit9a258664024d12a06ba8eb9344e270a9bb5f5d87 (patch)
tree676e8da975617ab58089358e2871e5fa11f1e732 /llvm/lib/CodeGen/MIRPrinter.cpp
parent1ead51a86c6c746a1b9948ca1ee142df223ffebd (diff)
downloadllvm-9a258664024d12a06ba8eb9344e270a9bb5f5d87.zip
llvm-9a258664024d12a06ba8eb9344e270a9bb5f5d87.tar.gz
llvm-9a258664024d12a06ba8eb9344e270a9bb5f5d87.tar.bz2
CodeGen: Avoid using MachineFunction::getMMI in MachineModuleSlotTracker (#100310)
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 48c3e0d..63fb887 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -101,13 +101,15 @@ namespace llvm {
/// format.
class MIRPrinter {
raw_ostream &OS;
+ const MachineModuleInfo &MMI;
DenseMap<const uint32_t *, unsigned> RegisterMaskIds;
/// Maps from stack object indices to operand indices which will be used when
/// printing frame index machine operands.
DenseMap<int, FrameIndexOperand> StackObjectOperandMapping;
public:
- MIRPrinter(raw_ostream &OS) : OS(OS) {}
+ MIRPrinter(raw_ostream &OS, const MachineModuleInfo &MMI)
+ : OS(OS), MMI(MMI) {}
void print(const MachineFunction &MF);
@@ -222,7 +224,7 @@ void MIRPrinter::print(const MachineFunction &MF) {
MachineFunctionProperties::Property::TracksDebugUserValues);
convert(YamlMF, MF.getRegInfo(), MF.getSubtarget().getRegisterInfo());
- MachineModuleSlotTracker MST(&MF);
+ MachineModuleSlotTracker MST(MMI, &MF);
MST.incorporateFunction(MF.getFunction());
convert(MST, YamlMF.FrameInfo, MF.getFrameInfo());
convertStackObjects(YamlMF, MF, MST);
@@ -1005,12 +1007,13 @@ void llvm::printMIR(raw_ostream &OS, const Module &M) {
Out << const_cast<Module &>(M);
}
-void llvm::printMIR(raw_ostream &OS, const MachineFunction &MF) {
+void llvm::printMIR(raw_ostream &OS, const MachineModuleInfo &MMI,
+ const MachineFunction &MF) {
// RemoveDIs: as there's no textual form for DbgRecords yet, print debug-info
// in dbg.value format.
ScopedDbgInfoFormatSetter FormatSetter(
const_cast<Function &>(MF.getFunction()), WriteNewDbgInfoFormat);
- MIRPrinter Printer(OS);
+ MIRPrinter Printer(OS, MMI);
Printer.print(MF);
}