[llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp
Chris Lattner
clattner at apple.com
Sun Apr 15 15:15:31 PDT 2007
>
> -unsigned ImmediateDominators::DFSPass(BasicBlock *V, InfoRec &VInfo,
> +unsigned DominatorTree::DFSPass(BasicBlock *V, InfoRec &VInfo,
> unsigned N) {
Plz indent 'unsigned N' right.
> +void DominatorTree::calculate(Function& F) {
> + BasicBlock* Root = Roots[0];
tab
> + // Loop over all of the reachable blocks in the function...
> + for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
> + if (BasicBlock *ImmDom = getIDom(I)) { // Reachable block.
> + Node *&BBNode = Nodes[I];
tab
> // Free temporary memory used to construct idom's
> Info.clear();
> + IDoms.clear();
> std::vector<BasicBlock*>().swap(Vertex);
tab
> // DominatorTreeBase::reset - Free all of the tree node memory.
> //
> void DominatorTreeBase::reset() {
> for (NodeMapType::iterator I = Nodes.begin(), E = Nodes.end();
> I != E; ++I)
> delete I->second;
> Nodes.clear();
> + IDoms.clear();
> + Roots.clear();
> RootNode = 0;
tabs
>
> +bool DominatorTree::runOnFunction(Function &F) {
> + reset(); // Reset from the last time we were run...
> + Roots.push_back(&F.getEntryBlock());
tab
-Chris
More information about the llvm-commits
mailing list