diff options
author | Chris Lattner <sabre@nondot.org> | 2002-06-25 16:13:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-06-25 16:13:24 +0000 |
commit | 7e70829632f82de15db187845666aaca6e04b792 (patch) | |
tree | 48dd2d804e7ebec9a3cbd8bf229cb2a2aa20dce5 /lib/Analysis/PostDominators.cpp | |
parent | 0b12b5f50ec77a8bd01b92d287c52d748619bb4b (diff) |
MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PostDominators.cpp')
-rw-r--r-- | lib/Analysis/PostDominators.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp index ca0b64a064..caff1f1db3 100644 --- a/lib/Analysis/PostDominators.cpp +++ b/lib/Analysis/PostDominators.cpp @@ -21,7 +21,7 @@ using std::set; AnalysisID DominatorSet::ID(AnalysisID::create<DominatorSet>(), true); AnalysisID DominatorSet::PostDomID(AnalysisID::create<DominatorSet>(), true); -bool DominatorSet::runOnFunction(Function *F) { +bool DominatorSet::runOnFunction(Function &F) { Doms.clear(); // Reset from the last time we were run... if (isPostDominator()) @@ -40,17 +40,17 @@ bool DominatorSet::dominates(Instruction *A, Instruction *B) const { // Loop through the basic block until we find A or B. BasicBlock::iterator I = BBA->begin(); - for (; *I != A && *I != B; ++I) /*empty*/; + for (; &*I != A && &*I != B; ++I) /*empty*/; // A dominates B if it is found first in the basic block... - return *I == A; + return &*I == A; } // calcForwardDominatorSet - This method calculates the forward dominator sets // for the specified function. // -void DominatorSet::calcForwardDominatorSet(Function *M) { - Root = M->getEntryNode(); +void DominatorSet::calcForwardDominatorSet(Function &F) { + Root = &F.getEntryNode(); assert(pred_begin(Root) == pred_end(Root) && "Root node has predecessors in function!"); @@ -59,7 +59,7 @@ void DominatorSet::calcForwardDominatorSet(Function *M) { Changed = false; DomSetType WorkingSet; - df_iterator<Function*> It = df_begin(M), End = df_end(M); + df_iterator<Function*> It = df_begin(&F), End = df_end(&F); for ( ; It != End; ++It) { BasicBlock *BB = *It; pred_iterator PI = pred_begin(BB), PEnd = pred_end(BB); @@ -93,7 +93,7 @@ void DominatorSet::calcForwardDominatorSet(Function *M) { // only have a single exit node (return stmt), then calculates the post // dominance sets for the function. // -void DominatorSet::calcPostDominatorSet(Function *F) { +void DominatorSet::calcPostDominatorSet(Function &F) { // Since we require that the unify all exit nodes pass has been run, we know // that there can be at most one return instruction in the function left. // Get it. @@ -101,8 +101,8 @@ void DominatorSet::calcPostDominatorSet(Function *F) { Root = getAnalysis<UnifyFunctionExitNodes>().getExitNode(); if (Root == 0) { // No exit node for the function? Postdomsets are all empty - for (Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI) - Doms[*FI] = DomSetType(); + for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) + Doms[FI] = DomSetType(); return; } |