llvm.org GIT mirror llvm / 340d78d
CodeGen: Create a proper ModuleSlotTracker for MachineInstr Another follow-up related to r240848: try a little harder to share slot tracking calculations within a single `MachineInstr` dump. This is unrelated to `MachineFunction::print()`, since that should be passing through the function's `ModuleSlotTracker` by now, but could affect the speed of dumping from a debugger if there is more than one IR-level operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240852 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 4 years ago
1 changed file(s) with 7 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
15311531 }
15321532
15331533 void MachineInstr::print(raw_ostream &OS, bool SkipOpers) const {
1534 ModuleSlotTracker DummyMST(nullptr);
1535 print(OS, DummyMST, SkipOpers);
1534 const Module *M = nullptr;
1535 if (const MachineBasicBlock *MBB = getParent())
1536 if (const MachineFunction *MF = MBB->getParent())
1537 M = MF->getFunction()->getParent();
1538
1539 ModuleSlotTracker MST(M);
1540 print(OS, MST, SkipOpers);
15361541 }
15371542
15381543 void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,