* Rename MethodPass class to FunctionPass
  - Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
index d689d93..9f908c6 100644
--- a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
+++ b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
@@ -95,11 +95,3 @@
     CW << " #" << Counter << ". " << (Value*)*I << "\n";
   }
 }
-
-// getAnalysisUsageInfo - Of course, we provide ourself...
-//
-void FindUnsafePointerTypes::getAnalysisUsageInfo(Pass::AnalysisSet &Required,
-                                                  Pass::AnalysisSet &Destroyed,
-                                                  Pass::AnalysisSet &Provided) {
-  Provided.push_back(FindUnsafePointerTypes::ID);
-}
diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp
index 5c961d2..86061d8 100644
--- a/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -93,11 +93,3 @@
            E = UsedTypes.end(); I != E; ++I)
       o << "  " << *I << "\n";
 }
-
-// getAnalysisUsageInfo - Of course, we provide ourself...
-//
-void FindUsedTypes::getAnalysisUsageInfo(Pass::AnalysisSet &Required,
-                                         Pass::AnalysisSet &Destroyed,
-                                         Pass::AnalysisSet &Provided) {
-  Provided.push_back(FindUsedTypes::ID);
-}
diff --git a/lib/Analysis/IntervalPartition.cpp b/lib/Analysis/IntervalPartition.cpp
index 197bed2..bb0f582 100644
--- a/lib/Analysis/IntervalPartition.cpp
+++ b/lib/Analysis/IntervalPartition.cpp
@@ -52,19 +52,19 @@
 // IntervalPartition ctor - Build the first level interval partition for the
 // specified function...
 //
-bool IntervalPartition::runOnMethod(Function *M) {
-  assert(M->front() && "Cannot operate on prototypes!");
+bool IntervalPartition::runOnFunction(Function *F) {
+  assert(F->front() && "Cannot operate on prototypes!");
 
   // Pass false to intervals_begin because we take ownership of it's memory
-  function_interval_iterator I = intervals_begin(M, false);
-  assert(I != intervals_end(M) && "No intervals in function!?!?!");
+  function_interval_iterator I = intervals_begin(F, false);
+  assert(I != intervals_end(F) && "No intervals in function!?!?!");
 
   addIntervalToPartition(RootInterval = *I);
 
   ++I;  // After the first one...
 
   // Add the rest of the intervals to the partition...
-  for_each(I, intervals_end(M),
+  for_each(I, intervals_end(F),
 	   bind_obj(this, &IntervalPartition::addIntervalToPartition));
 
   // Now that we know all of the successor information, propogate this to the
diff --git a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
index e9e4245..0518aef 100644
--- a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
+++ b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
@@ -1,6 +1,6 @@
-//===-- MethodLiveVarInfo.cpp - Live Variable Analysis for a Function -----===//
+//===-- FunctionLiveVarInfo.cpp - Live Variable Analysis for a Function ---===//
 //
-// This is the interface to method level live variable information that is
+// This is the interface to function level live variable information that is
 // provided by live variable analysis.
 //
 //===----------------------------------------------------------------------===//
@@ -39,10 +39,10 @@
 
 
 //-----------------------------------------------------------------------------
-// Performs live var analysis for a method
+// Performs live var analysis for a function
 //-----------------------------------------------------------------------------
 
-bool MethodLiveVarInfo::runOnMethod(Function *Meth) {
+bool MethodLiveVarInfo::runOnFunction(Function *Meth) {
   M = Meth;
   if (DEBUG_LV) std::cerr << "Analysing live variables ...\n";
 
@@ -149,12 +149,12 @@
 
 //-----------------------------------------------------------------------------
 // Following functions will give the LiveVar info for any machine instr in
-// a method. It should be called after a call to analyze().
+// a function. It should be called after a call to analyze().
 //
 // Thsese functions calucluates live var info for all the machine instrs in a 
 // BB when LVInfo for one inst is requested. Hence, this function is useful 
 // when live var info is required for many (or all) instructions in a basic 
-// block. Also, the arguments to this method does not require specific 
+// block. Also, the arguments to this function does not require specific 
 // iterators.
 //-----------------------------------------------------------------------------
 
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index ef47936..c34aef7 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -35,7 +35,7 @@
 //===----------------------------------------------------------------------===//
 // cfg::LoopInfo implementation
 //
-bool cfg::LoopInfo::runOnMethod(Function *F) {
+bool cfg::LoopInfo::runOnFunction(Function *F) {
   releaseMemory();
   Calculate(getAnalysis<DominatorSet>());    // Update
   return false;
@@ -53,11 +53,10 @@
     TopLevelLoops[i]->setLoopDepth(1);
 }
 
-void cfg::LoopInfo::getAnalysisUsageInfo(Pass::AnalysisSet &Required,
-                                         Pass::AnalysisSet &Destroyed,
-                                         Pass::AnalysisSet &Provided) {
-  Required.push_back(DominatorSet::ID);
-  Provided.push_back(ID);
+void cfg::LoopInfo::getAnalysisUsage(AnalysisUsage &AU) const {
+  AU.setPreservesAll();
+  AU.addRequired(DominatorSet::ID);
+  AU.addProvided(ID);
 }
 
 
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp
index 71ee3d7..387b673 100644
--- a/lib/Analysis/PostDominators.cpp
+++ b/lib/Analysis/PostDominators.cpp
@@ -22,7 +22,7 @@
 AnalysisID cfg::DominatorSet::ID(AnalysisID::create<cfg::DominatorSet>());
 AnalysisID cfg::DominatorSet::PostDomID(AnalysisID::create<cfg::DominatorSet>());
 
-bool cfg::DominatorSet::runOnMethod(Function *F) {
+bool cfg::DominatorSet::runOnFunction(Function *F) {
   Doms.clear();   // Reset from the last time we were run...
 
   if (isPostDominator())
@@ -129,17 +129,16 @@
   } while (Changed);
 }
 
-// getAnalysisUsageInfo - This obviously provides a dominator set, but it also
-// uses the UnifyMethodExitNodes pass if building post-dominators
+// getAnalysisUsage - This obviously provides a dominator set, but it also
+// uses the UnifyFunctionExitNodes pass if building post-dominators
 //
-void cfg::DominatorSet::getAnalysisUsageInfo(Pass::AnalysisSet &Requires,
-                                             Pass::AnalysisSet &Destroyed,
-                                             Pass::AnalysisSet &Provided) {
+void cfg::DominatorSet::getAnalysisUsage(AnalysisUsage &AU) const {
+  AU.setPreservesAll();
   if (isPostDominator()) {
-    Provided.push_back(PostDomID);
-    Requires.push_back(UnifyMethodExitNodes::ID);
+    AU.addProvided(PostDomID);
+    AU.addRequired(UnifyMethodExitNodes::ID);
   } else {
-    Provided.push_back(ID);
+    AU.addProvided(ID);
   }
 }