[llvm] r287302 - MachineOperand: Add dump() method

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 18:40:40 PST 2016


Author: matze
Date: Thu Nov 17 20:40:40 2016
New Revision: 287302

URL: http://llvm.org/viewvc/llvm-project?rev=287302&view=rev
Log:
MachineOperand: Add dump() method

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineOperand.h
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOperand.h?rev=287302&r1=287301&r2=287302&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineOperand.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineOperand.h Thu Nov 17 20:40:40 2016
@@ -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.

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=287302&r1=287301&r2=287302&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Nov 17 20:40:40 2016
@@ -497,6 +497,12 @@ void MachineOperand::print(raw_ostream &
     OS << "[TF=" << TF << ']';
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+LLVM_DUMP_METHOD void MachineOperand::dump() const {
+  dbgs() << *this << '\n';
+}
+#endif
+
 //===----------------------------------------------------------------------===//
 // MachineMemOperand Implementation
 //===----------------------------------------------------------------------===//




More information about the llvm-commits mailing list