[llvm-commits] [llvm] r154286 - /llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp

Chandler Carruth chandlerc at gmail.com
Sun Apr 8 07:37:01 PDT 2012


Author: chandlerc
Date: Sun Apr  8 09:37:01 2012
New Revision: 154286

URL: http://llvm.org/viewvc/llvm-project?rev=154286&view=rev
Log:
Add a debug-only 'dump' method to the BlockChain structure to ease
debugging.

Modified:
    llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp

Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=154286&r1=154285&r2=154286&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Sun Apr  8 09:37:01 2012
@@ -141,6 +141,14 @@
     }
   }
 
+#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





More information about the llvm-commits mailing list