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
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp
index ca0b64a..caff1f1 100644
--- a/lib/Analysis/PostDominators.cpp
+++ b/lib/Analysis/PostDominators.cpp
@@ -21,7 +21,7 @@
 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 @@
   
   // 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 @@
     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 @@
 // 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 @@
   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;
   }