From 49158908dceeccda0f37254b48ff5711695911c8 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 8 Apr 2012 14:37:01 +0000 Subject: [PATCH] Add a debug-only 'dump' method to the BlockChain structure to ease debugging. llvm-svn: 154286 --- llvm/lib/CodeGen/MachineBlockPlacement.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index 63892af890a8..07b7318ef2e4 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -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