aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-26 03:41:59 +0000
committerChris Lattner <sabre@nondot.org>2006-09-26 03:41:59 +0000
commit681764b20c3418b4af783a84eb2a68145d69a9d7 (patch)
tree4344c00da557f176b2729393b5f46a298d2468df /lib/CodeGen/MachineBasicBlock.cpp
parenta53115b4c254885fa19bbedf96d8d491204b86e8 (diff)
downloadexternal_llvm-681764b20c3418b4af783a84eb2a68145d69a9d7.zip
external_llvm-681764b20c3418b4af783a84eb2a68145d69a9d7.tar.gz
external_llvm-681764b20c3418b4af783a84eb2a68145d69a9d7.tar.bz2
print the preds of each MBB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index 84d2657..de397d3 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/lib/CodeGen/MachineBasicBlock.cpp
@@ -97,6 +97,14 @@ void MachineBasicBlock::print(std::ostream &OS) const {
if (LBB)
OS << "\n" << LBB->getName() << " (" << (const void*)this
<< ", LLVM BB @" << (const void*) LBB << "):\n";
+ // Print the preds of this block according to the CFG.
+ if (!pred_empty()) {
+ OS << " Predecessors according to CFG:";
+ for (const_pred_iterator PI = pred_begin(), E = pred_end(); PI != E; ++PI)
+ OS << " " << *PI;
+ OS << "\n";
+ }
+
for (const_iterator I = begin(); I != end(); ++I) {
OS << "\t";
I->print(OS, &getParent()->getTarget());