]> granicus.if.org Git - llvm/commitdiff
MachineInstr: Remove parameter from dump()
authorMatthias Braun <matze@braunis.de>
Sun, 29 Jan 2017 18:20:42 +0000 (18:20 +0000)
committerMatthias Braun <matze@braunis.de>
Sun, 29 Jan 2017 18:20:42 +0000 (18:20 +0000)
The primary use of the dump() functions in LLVM is for use in a
debugger. Unfortunately lldb does not seem to handle default arguments
so using `p SomeMI.dump()` fails and you have to type the longer `p
SomeMI.dump(nullptr)`. Remove the paramter to make the most common use
easy. (You can always construct something like `p
SomeMI.print(dbgs(),MyTII)` if you need more features).

Differential Revision: https://reviews.llvm.org/D29241

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293440 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/MachineCombiner.cpp
lib/CodeGen/MachineInstr.cpp

index bac93e5d3a4c3f16b0c960167cc7867a5022218e..828aef590aa34f5e5fcbbfc1b4927f36d53dc868 100644 (file)
@@ -1153,7 +1153,7 @@ public:
              const TargetInstrInfo *TII = nullptr) const;
   void print(raw_ostream &OS, ModuleSlotTracker &MST, bool SkipOpers = false,
              const TargetInstrInfo *TII = nullptr) const;
-  void dump(const TargetInstrInfo *TII = nullptr) const;
+  void dump() const;
 
   //===--------------------------------------------------------------------===//
   // Accessors used to build up machine instructions.
index 5beed5f5dd0876595ea1138d85e8061958ab6f56..1ec03c0e0e10b3379ed7235e855d0600f13b2896 100644 (file)
@@ -135,7 +135,9 @@ MachineCombiner::getDepth(SmallVectorImpl<MachineInstr *> &InsInstrs,
   // are tracked in the InstrIdxForVirtReg map depth is looked up in InstrDepth
   for (auto *InstrPtr : InsInstrs) { // for each Use
     unsigned IDepth = 0;
-    DEBUG(dbgs() << "NEW INSTR "; InstrPtr->dump(TII); dbgs() << "\n";);
+    DEBUG(dbgs() << "NEW INSTR ";
+          InstrPtr->print(dbgs(), TII);
+          dbgs() << "\n";);
     for (const MachineOperand &MO : InstrPtr->operands()) {
       // Check for virtual register operand.
       if (!(MO.isReg() && TargetRegisterInfo::isVirtualRegister(MO.getReg())))
index b7f8e1ce68b017b61d99387ce0b6ef3722c8a752..011f6be77706055a1d457de94396a8e933a589b8 100644 (file)
@@ -1693,9 +1693,9 @@ void MachineInstr::copyImplicitOps(MachineFunction &MF,
 }
 
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
-LLVM_DUMP_METHOD void MachineInstr::dump(const TargetInstrInfo *TII) const {
+LLVM_DUMP_METHOD void MachineInstr::dump() const {
   dbgs() << "  ";
-  print(dbgs(), false /* SkipOpers */, TII);
+  print(dbgs());
 }
 #endif