From: Chris Lattner Date: Sat, 19 Jun 2004 20:04:47 +0000 (+0000) Subject: Print out immediate dominators in program order, not in random order based on the... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f6437a3023c704e9cb4488b2fb58494a81e2a259;p=oota-llvm.git 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 --- diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp index 0f68bb4d025..76ad59b3544 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 << " <>"; + 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 << " <>"; o << "\n";