diff options
-rw-r--r-- | llvm/include/llvm/CodeGen/MachineInstr.h | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index 828aef590aa..3331452ce8e 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -1149,9 +1149,10 @@ public: // // Debugging support // - void print(raw_ostream &OS, bool SkipOpers = false, + void print(raw_ostream &OS, bool SkipOpers = false, bool SkipDebugLoc = false, const TargetInstrInfo *TII = nullptr) const; void print(raw_ostream &OS, ModuleSlotTracker &MST, bool SkipOpers = false, + bool SkipDebugLoc = false, const TargetInstrInfo *TII = nullptr) const; void dump() const; diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 011f6be7770..acd61dddd20 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -1699,7 +1699,7 @@ LLVM_DUMP_METHOD void MachineInstr::dump() const { } #endif -void MachineInstr::print(raw_ostream &OS, bool SkipOpers, +void MachineInstr::print(raw_ostream &OS, bool SkipOpers, bool SkipDebugLoc, const TargetInstrInfo *TII) const { const Module *M = nullptr; if (const MachineBasicBlock *MBB = getParent()) @@ -1707,11 +1707,12 @@ void MachineInstr::print(raw_ostream &OS, bool SkipOpers, M = MF->getFunction()->getParent(); ModuleSlotTracker MST(M); - print(OS, MST, SkipOpers, TII); + print(OS, MST, SkipOpers, SkipDebugLoc, TII); } void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST, - bool SkipOpers, const TargetInstrInfo *TII) const { + bool SkipOpers, bool SkipDebugLoc, + const TargetInstrInfo *TII) const { // We can be a bit tidier if we know the MachineFunction. const MachineFunction *MF = nullptr; const TargetRegisterInfo *TRI = nullptr; @@ -1987,7 +1988,7 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST, } if (isIndirectDebugValue()) OS << " indirect"; - } else if (debugLoc && MF) { + } else if (debugLoc && MF && !SkipDebugLoc) { if (!HaveSemi) OS << ";"; OS << " dbg:"; |