MachineOperand: Add dump() method
authorMatthias Braun <matze@braunis.de>
Fri, 18 Nov 2016 02:40:40 +0000 (02:40 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 18 Nov 2016 02:40:40 +0000 (02:40 +0000)
llvm-svn: 287302

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

index cf46079..5df99a6 100644 (file)
@@ -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.
index dca0c93..4567654 100644 (file)
@@ -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
 //===----------------------------------------------------------------------===//