Make DomTree and PostDomTree thin wrappers around DomTreeBase, rather than inheriting from it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43259 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2007-10-23 20:58:37 +00:00
parent 7bb175b4d1
commit d20cc14dbf
3 changed files with 27 additions and 33 deletions

View File

@ -29,25 +29,7 @@ static RegisterPass<PostDominatorTree>
F("postdomtree", "Post-Dominator Tree Construction", true);
bool PostDominatorTree::runOnFunction(Function &F) {
reset(); // Reset from the last time we were run...
// Initialize the roots list
for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
TerminatorInst *Insn = I->getTerminator();
if (Insn->getNumSuccessors() == 0) {
// Unreachable block is not a root node.
if (!isa<UnreachableInst>(Insn))
Roots.push_back(I);
}
// Prepopulate maps so that we don't get iterator invalidation issues later.
IDoms[I] = 0;
DomTreeNodes[I] = 0;
}
Vertex.push_back(0);
Calculate<Inverse<BasicBlock*>, GraphTraits<Inverse<BasicBlock*> > >(*this, F);
DT->recalculate(F);
return false;
}