Add a debug-only 'dump' method to the BlockChain structure to ease
authorChandler Carruth <chandlerc@gmail.com>
Sun, 8 Apr 2012 14:37:01 +0000 (14:37 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 8 Apr 2012 14:37:01 +0000 (14:37 +0000)
debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154286 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineBlockPlacement.cpp

index 63892af890a816e1b0739e6c931639c5296c9466..07b7318ef2e4be8606557c8db1015872f1892146 100644 (file)
@@ -141,6 +141,14 @@ public:
     }
   }
 
+#ifndef NDEBUG
+  /// \brief Dump the blocks in this chain.
+  void dump() LLVM_ATTRIBUTE_USED {
+    for (iterator I = begin(), E = end(); I != E; ++I)
+      (*I)->dump();
+  }
+#endif // NDEBUG
+
   /// \brief Count of predecessors within the loop currently being processed.
   ///
   /// This count is updated at each loop we process to represent the number of