summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/MachineInstr.h12
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp4
2 files changed, 12 insertions, 4 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h
index 3331452ce8e..4a24a004230 100644
--- a/llvm/include/llvm/CodeGen/MachineInstr.h
+++ b/llvm/include/llvm/CodeGen/MachineInstr.h
@@ -1146,15 +1146,21 @@ public:
/// instruction to this instruction.
void copyImplicitOps(MachineFunction &MF, const MachineInstr &MI);
- //
- // Debugging support
- //
+ /// Debugging support
+ /// @{
+ /// Print this MI to \p OS.
+ /// Only print the defs and the opcode if \p SkipOpers is true.
+ /// Otherwise, also print operands if \p SkipDebugLoc is true.
+ /// Otherwise, also print the debug loc, with a terminating newline.
+ /// \p TII is used to print the opcode name. If it's not present, but the
+ /// MI is in a function, the opcode will be printed using the function's TII.
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;
+ /// @}
//===--------------------------------------------------------------------===//
// Accessors used to build up machine instructions.
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index acd61dddd20..f1e16565bca 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1988,7 +1988,9 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
}
if (isIndirectDebugValue())
OS << " indirect";
- } else if (debugLoc && MF && !SkipDebugLoc) {
+ } else if (SkipDebugLoc) {
+ return;
+ } else if (debugLoc && MF) {
if (!HaveSemi)
OS << ";";
OS << " dbg:";
OpenPOWER on IntegriCloud