From 9e79f14ca205dca5823016f8358ce87890416c43 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 18 Nov 2016 02:40:40 +0000 Subject: [PATCH] MachineOperand: Add dump() method llvm-svn: 287302 --- include/llvm/CodeGen/MachineOperand.h | 1 + lib/CodeGen/MachineInstr.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h index cf4607957f9..5df99a6c807 100644 --- a/include/llvm/CodeGen/MachineOperand.h +++ b/include/llvm/CodeGen/MachineOperand.h @@ -229,6 +229,7 @@ public: void print(raw_ostream &os, ModuleSlotTracker &MST, const TargetRegisterInfo *TRI = nullptr, const TargetIntrinsicInfo *IntrinsicInfo = nullptr) const; + LLVM_DUMP_METHOD void dump() const; //===--------------------------------------------------------------------===// // Accessors that tell you what kind of MachineOperand you're looking at. diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index dca0c93aea3..4567654b5e0 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -497,6 +497,12 @@ void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST, OS << "[TF=" << TF << ']'; } +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +LLVM_DUMP_METHOD void MachineOperand::dump() const { + dbgs() << *this << '\n'; +} +#endif + //===----------------------------------------------------------------------===// // MachineMemOperand Implementation //===----------------------------------------------------------------------===//