aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Dominators.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-19 20:04:47 +0000
committerChris Lattner <sabre@nondot.org>2004-06-19 20:04:47 +0000
commitf6437a3023c704e9cb4488b2fb58494a81e2a259 (patch)
tree9709540587735a3031f571dc84cbba55782594c5 /lib/VMCore/Dominators.cpp
parentaee7940d53a978c9e3ac48bdc9a5f122dfb60845 (diff)
downloadexternal_llvm-f6437a3023c704e9cb4488b2fb58494a81e2a259.zip
external_llvm-f6437a3023c704e9cb4488b2fb58494a81e2a259.tar.gz
external_llvm-f6437a3023c704e9cb4488b2fb58494a81e2a259.tar.bz2
Print out immediate dominators in program order, not in random order based on the address
of BasicBlock objects git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Dominators.cpp')
-rw-r--r--lib/VMCore/Dominators.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp
index 0f68bb4..76ad59b 100644
--- a/lib/VMCore/Dominators.cpp
+++ b/lib/VMCore/Dominators.cpp
@@ -211,15 +211,13 @@ bool ImmediateDominators::runOnFunction(Function &F) {
}
void ImmediateDominatorsBase::print(std::ostream &o) const {
- for (const_iterator I = begin(), E = end(); I != E; ++I) {
+ Function *F = getRoots()[0]->getParent();
+ for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) {
o << " Immediate Dominator For Basic Block:";
- if (I->first)
- WriteAsOperand(o, I->first, false);
- else
- o << " <<exit node>>";
+ WriteAsOperand(o, I, false);
o << " is:";
- if (I->second)
- WriteAsOperand(o, I->second, false);
+ if (BasicBlock *ID = get(I))
+ WriteAsOperand(o, ID, false);
else
o << " <<exit node>>";
o << "\n";