'Pass' should now not be derived from by clients.  Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16436 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/AliasAnalysisCounter.cpp b/lib/Analysis/AliasAnalysisCounter.cpp
index 09fd6b9..b17941f 100644
--- a/lib/Analysis/AliasAnalysisCounter.cpp
+++ b/lib/Analysis/AliasAnalysisCounter.cpp
@@ -18,7 +18,7 @@
 using namespace llvm;
 
 namespace {
-  class AliasAnalysisCounter : public Pass, public AliasAnalysis {
+  class AliasAnalysisCounter : public ModulePass, public AliasAnalysis {
     unsigned No, May, Must;
     unsigned NoMR, JustRef, JustMod, MR;
     const char *Name;
@@ -64,7 +64,7 @@
       }
     }
 
-    bool run(Module &M) {
+    bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);
       Name = dynamic_cast<Pass*>(&getAnalysis<AliasAnalysis>())->getPassName();
       return false;
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp
index 4bc6faf..bf4b01c 100644
--- a/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -35,7 +35,7 @@
 // run - Calculate the bottom up data structure graphs for each function in the
 // program.
 //
-bool BUDataStructures::run(Module &M) {
+bool BUDataStructures::runOnModule(Module &M) {
   LocalDataStructures &LocalDSA = getAnalysis<LocalDataStructures>();
   GlobalsGraph = new DSGraph(LocalDSA.getGlobalsGraph());
   GlobalsGraph->setPrintAuxCalls();
diff --git a/lib/Analysis/DataStructure/CompleteBottomUp.cpp b/lib/Analysis/DataStructure/CompleteBottomUp.cpp
index b2a0f4b..ee111e9 100644
--- a/lib/Analysis/DataStructure/CompleteBottomUp.cpp
+++ b/lib/Analysis/DataStructure/CompleteBottomUp.cpp
@@ -32,7 +32,7 @@
 // run - Calculate the bottom up data structure graphs for each function in the
 // program.
 //
-bool CompleteBUDataStructures::run(Module &M) {
+bool CompleteBUDataStructures::runOnModule(Module &M) {
   BUDataStructures &BU = getAnalysis<BUDataStructures>();
   GlobalsGraph = new DSGraph(BU.getGlobalsGraph());
   GlobalsGraph->setPrintAuxCalls();
diff --git a/lib/Analysis/DataStructure/DataStructureAA.cpp b/lib/Analysis/DataStructure/DataStructureAA.cpp
index 3cff795..6444cc8 100644
--- a/lib/Analysis/DataStructure/DataStructureAA.cpp
+++ b/lib/Analysis/DataStructure/DataStructureAA.cpp
@@ -19,7 +19,7 @@
 using namespace llvm;
 
 namespace {
-  class DSAA : public Pass, public AliasAnalysis {
+  class DSAA : public ModulePass, public AliasAnalysis {
     TDDataStructures *TD;
     BUDataStructures *BU;
   public:
@@ -32,7 +32,7 @@
     // run - Build up the result graph, representing the pointer graph for the
     // program.
     //
-    bool run(Module &M) {
+    bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);
       TD = &getAnalysis<TDDataStructures>();
       BU = &getAnalysis<BUDataStructures>();
diff --git a/lib/Analysis/DataStructure/DataStructureOpt.cpp b/lib/Analysis/DataStructure/DataStructureOpt.cpp
index f7a1ed9..1996aea 100644
--- a/lib/Analysis/DataStructure/DataStructureOpt.cpp
+++ b/lib/Analysis/DataStructure/DataStructureOpt.cpp
@@ -25,10 +25,10 @@
   Statistic<>
   NumGlobalsIsolated("ds-opt", "Number of globals with references dropped");
 
-  class DSOpt : public Pass {
+  class DSOpt : public ModulePass {
     TDDataStructures *TD;
   public:
-    bool run(Module &M) {
+    bool runOnModule(Module &M) {
       TD = &getAnalysis<TDDataStructures>();
       bool Changed = OptimizeGlobals(M);
       return Changed;
diff --git a/lib/Analysis/DataStructure/IPModRef.cpp b/lib/Analysis/DataStructure/IPModRef.cpp
index ccc15f7..6793b0e 100644
--- a/lib/Analysis/DataStructure/IPModRef.cpp
+++ b/lib/Analysis/DataStructure/IPModRef.cpp
@@ -374,7 +374,7 @@
 // NO real interprocedural work because all that has been done the
 // data structure analysis.
 // 
-bool IPModRef::run(Module &theModule)
+bool IPModRef::runOnModule(Module &theModule)
 {
   M = &theModule;
 
diff --git a/lib/Analysis/DataStructure/IPModRef.h b/lib/Analysis/DataStructure/IPModRef.h
index 4a825db..f8ac15c 100644
--- a/lib/Analysis/DataStructure/IPModRef.h
+++ b/lib/Analysis/DataStructure/IPModRef.h
@@ -183,7 +183,7 @@
 /// from an arbitrary callsite, or during an execution of a single call-site
 /// within the function.
 ///
-class IPModRef : public Pass {
+class IPModRef : public ModulePass {
   std::map<const Function*, FunctionModRefInfo*> funcToModRefInfoMap;
   Module* M;
 
@@ -197,7 +197,7 @@
   /// This initializes the module reference, and then computes IPModRef
   /// results immediately if demand-driven analysis was *not* specified.
   /// 
-  virtual bool run(Module &M);
+  virtual bool runOnModule(Module &M);
 
   /// getFunctionModRefInfo - Retrieve the Mod/Ref information for a single
   /// function
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index b21f2f1..070d037 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -1023,7 +1023,7 @@
 }
 
 
-bool LocalDataStructures::run(Module &M) {
+bool LocalDataStructures::runOnModule(Module &M) {
   GlobalsGraph = new DSGraph(getAnalysis<TargetData>());
 
   const TargetData &TD = getAnalysis<TargetData>();
diff --git a/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp b/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp
index 49b6425..f6c54fb 100644
--- a/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp
+++ b/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp
@@ -457,7 +457,7 @@
 // Driver function to compute dependence graphs for every function.
 // This is temporary and will go away once this is a FunctionPass.
 // 
-bool MemoryDepAnalysis::run(Module& M)
+bool MemoryDepAnalysis::runOnModule(Module& M)
 {
   for (Module::iterator FI = M.begin(), FE = M.end(); FI != FE; ++FI)
     if (! FI->isExternal())
diff --git a/lib/Analysis/DataStructure/MemoryDepAnalysis.h b/lib/Analysis/DataStructure/MemoryDepAnalysis.h
index 570a03b..ed21e5f 100644
--- a/lib/Analysis/DataStructure/MemoryDepAnalysis.h
+++ b/lib/Analysis/DataStructure/MemoryDepAnalysis.h
@@ -40,7 +40,7 @@
 /// allowed to use a FunctionPass such as this one.
 ///---------------------------------------------------------------------------
 
-class MemoryDepAnalysis : public Pass {
+class MemoryDepAnalysis : public ModulePass {
   /// The following map and depGraph pointer are temporary until this class
   /// becomes a FunctionPass instead of a module Pass.
   hash_map<Function*, DependenceGraph*> funcMap;
@@ -63,7 +63,7 @@
 
   /// Driver function to compute dependence graphs for every function.
   ///
-  bool run(Module &M);
+  bool runOnModule(Module &M);
 
   /// getGraph - Retrieve the dependence graph for a function.
   /// This is temporary and will go away once this is a FunctionPass.
diff --git a/lib/Analysis/DataStructure/Parallelize.cpp b/lib/Analysis/DataStructure/Parallelize.cpp
index 3dcb05e..2bb6c7f 100644
--- a/lib/Analysis/DataStructure/Parallelize.cpp
+++ b/lib/Analysis/DataStructure/Parallelize.cpp
@@ -388,11 +388,11 @@
 //---------------------------------------------------------------------------- 
 
 namespace {
-  class Parallelize: public Pass {
+  class Parallelize : public ModulePass {
   public:
     /// Driver functions to transform a program
     ///
-    bool run(Module& M);
+    bool runOnModule(Module& M);
 
     /// getAnalysisUsage - Modifies extensively so preserve nothing.
     /// Uses the DependenceGraph and the Top-down DS Graph (only to find
@@ -409,7 +409,7 @@
 }
 
 
-bool Parallelize::run(Module& M) {
+bool Parallelize::runOnModule(Module& M) {
   hash_set<Function*> parallelFunctions;
   hash_set<Function*> safeParallelFunctions;
   hash_set<const GlobalValue*> indirectlyCalled;
diff --git a/lib/Analysis/DataStructure/PgmDependenceGraph.h b/lib/Analysis/DataStructure/PgmDependenceGraph.h
index ec6f927..d777494 100644
--- a/lib/Analysis/DataStructure/PgmDependenceGraph.h
+++ b/lib/Analysis/DataStructure/PgmDependenceGraph.h
@@ -200,7 +200,7 @@
 /// allowed to use a FunctionPass such as this one.
 ///---------------------------------------------------------------------------
 
-class PgmDependenceGraph: public Pass {
+class PgmDependenceGraph: public ModulePass {
 
   /// Information about the function being analyzed.
   /// 
@@ -253,7 +253,7 @@
 
   /// Driver function to compute dependence graphs for every function.
   /// 
-  bool run(Module& M) { return true; }
+  bool runOnModule(Module& M) { return true; }
 
   /// getGraph() -- Retrieve the pgm dependence graph for a function.
   /// This is temporary and will go away once this is a FunctionPass.
diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp
index deeb8b3..b0718a1 100644
--- a/lib/Analysis/DataStructure/Steensgaard.cpp
+++ b/lib/Analysis/DataStructure/Steensgaard.cpp
@@ -22,7 +22,7 @@
 using namespace llvm;
 
 namespace {
-  class Steens : public Pass, public AliasAnalysis {
+  class Steens : public ModulePass, public AliasAnalysis {
     DSGraph *ResultGraph;
     DSGraph *GlobalsGraph;  // FIXME: Eliminate globals graph stuff from DNE
   public:
@@ -39,7 +39,7 @@
     // run - Build up the result graph, representing the pointer graph for the
     // program.
     //
-    bool run(Module &M);
+    bool runOnModule(Module &M);
 
     virtual void releaseMyMemory() { delete ResultGraph; ResultGraph = 0; }
 
@@ -103,7 +103,7 @@
 /// run - Build up the result graph, representing the pointer graph for the
 /// program.
 ///
-bool Steens::run(Module &M) {
+bool Steens::runOnModule(Module &M) {
   InitializeAliasAnalysis(this);
   assert(ResultGraph == 0 && "Result graph already allocated!");
   LocalDataStructures &LDS = getAnalysis<LocalDataStructures>();
diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp
index 1d861e8..6271980 100644
--- a/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -51,7 +51,7 @@
 // run - Calculate the top down data structure graphs for each function in the
 // program.
 //
-bool TDDataStructures::run(Module &M) {
+bool TDDataStructures::runOnModule(Module &M) {
   BUDataStructures &BU = getAnalysis<BUDataStructures>();
   GlobalsGraph = new DSGraph(BU.getGlobalsGraph());
   GlobalsGraph->setPrintAuxCalls();
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index 7901c91..9ade25e 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/lib/Analysis/IPA/Andersens.cpp
@@ -75,7 +75,7 @@
   Statistic<>
   NumIndirectCallees("anders-aa", "Number of indirect callees found");
 
-  class Andersens : public Pass, public AliasAnalysis,
+  class Andersens : public ModulePass, public AliasAnalysis,
                     private InstVisitor<Andersens> {
     /// Node class - This class is used to represent a memory object in the
     /// program, and is the primitive used to build the points-to graph.
@@ -193,7 +193,7 @@
     };
     
   public:
-    bool run(Module &M) {
+    bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);
       IdentifyObjects(M);
       CollectConstraints(M);
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index dbf5b9f..a6d2836 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -100,7 +100,7 @@
     }
 }
 
-bool CallGraph::run(Module &M) {
+bool CallGraph::runOnModule(Module &M) {
   destroy();
 
   Mod = &M;
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index f7d7ab1..8eb1c12 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -28,7 +28,7 @@
   AU.addPreserved<CallGraph>();
 }
 
-bool CallGraphSCCPass::run(Module &M) {
+bool CallGraphSCCPass::runOnModule(Module &M) {
   CallGraph &CG = getAnalysis<CallGraph>();
   bool Changed = doInitialization(CG);
   for (scc_iterator<CallGraph*> I = scc_begin(&CG), E = scc_end(&CG);
diff --git a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
index 23ee99a..c0d0a62 100644
--- a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
+++ b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
@@ -58,7 +58,7 @@
 }
 
 
-bool FindUnsafePointerTypes::run(Module &Mod) {
+bool FindUnsafePointerTypes::runOnModule(Module &Mod) {
   for (Module::iterator FI = Mod.begin(), E = Mod.end();
        FI != E; ++FI) {
     const Function *F = FI;  // We don't need/want write access
diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp
index 1f127fe..cb6b05c 100644
--- a/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -58,7 +58,7 @@
 
 // run - This incorporates all types used by the specified module
 //
-bool FindUsedTypes::run(Module &m) {
+bool FindUsedTypes::runOnModule(Module &m) {
   UsedTypes.clear();  // reset if run multiple times...
 
   // Loop over global variables, incorporating their types
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp
index c1f15ed..2c4ad4a 100644
--- a/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -67,7 +67,7 @@
   };
 
   /// GlobalsModRef - The actual analysis pass.
-  class GlobalsModRef : public Pass, public AliasAnalysis {
+  class GlobalsModRef : public ModulePass, public AliasAnalysis {
     /// NonAddressTakenGlobals - The globals that do not have their addresses
     /// taken.
     std::set<GlobalValue*> NonAddressTakenGlobals;
@@ -77,7 +77,7 @@
     std::map<Function*, FunctionRecord> FunctionInfo;
 
   public:
-    bool run(Module &M) {
+    bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);                 // set up super class
       AnalyzeGlobals(M);                          // find non-addr taken globals
       AnalyzeCallGraph(getAnalysis<CallGraph>(), M); // Propagate on CG
diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp
index cd3f575..333e9e0 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/lib/Analysis/ProfileInfoLoaderPass.cpp
@@ -28,7 +28,7 @@
                       cl::value_desc("filename"),
                       cl::desc("Profile file loaded by -profile-loader"));
 
-  class LoaderPass : public Pass, public ProfileInfo {
+  class LoaderPass : public ModulePass, public ProfileInfo {
     std::string Filename;
   public:
     LoaderPass(const std::string &filename = "")
@@ -45,7 +45,7 @@
     }
 
     /// run - Load the profile information from the specified file.
-    virtual bool run(Module &M);
+    virtual bool runOnModule(Module &M);
   };
  
   RegisterOpt<LoaderPass>
@@ -62,7 +62,7 @@
   return new LoaderPass(Filename);
 }
 
-bool LoaderPass::run(Module &M) {
+bool LoaderPass::runOnModule(Module &M) {
   ProfileInfoLoader PIL("profile-loader", Filename, M);
   EdgeCounts.clear();
   bool PrintedWarning = false;