From 4f2cf030e899f5fea5c2760326c853e89a2e8235 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 20 Sep 2004 04:48:05 +0000 Subject: '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. llvm-svn: 16436 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp | 4 ++-- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp | 2 +- llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp | 2 +- llvm/lib/Analysis/DataStructure/DataStructureAA.cpp | 4 ++-- llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp | 4 ++-- llvm/lib/Analysis/DataStructure/IPModRef.cpp | 2 +- llvm/lib/Analysis/DataStructure/IPModRef.h | 4 ++-- llvm/lib/Analysis/DataStructure/Local.cpp | 2 +- llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp | 2 +- llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.h | 4 ++-- llvm/lib/Analysis/DataStructure/Parallelize.cpp | 6 +++--- llvm/lib/Analysis/DataStructure/PgmDependenceGraph.h | 4 ++-- llvm/lib/Analysis/DataStructure/Steensgaard.cpp | 6 +++--- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp | 2 +- llvm/lib/Analysis/IPA/Andersens.cpp | 4 ++-- llvm/lib/Analysis/IPA/CallGraph.cpp | 2 +- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | 2 +- llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp | 2 +- llvm/lib/Analysis/IPA/FindUsedTypes.cpp | 2 +- llvm/lib/Analysis/IPA/GlobalsModRef.cpp | 4 ++-- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp | 6 +++--- 21 files changed, 35 insertions(+), 35 deletions(-) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/AliasAnalysisCounter.cpp b/llvm/lib/Analysis/AliasAnalysisCounter.cpp index 09fd6b9e0e4..b17941fdece 100644 --- a/llvm/lib/Analysis/AliasAnalysisCounter.cpp +++ b/llvm/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 @@ namespace { } } - bool run(Module &M) { + bool runOnModule(Module &M) { InitializeAliasAnalysis(this); Name = dynamic_cast(&getAnalysis())->getPassName(); return false; diff --git a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp index 4bc6fafcf63..bf4b01cfc1e 100644 --- a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -35,7 +35,7 @@ using namespace DS; // 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(); GlobalsGraph = new DSGraph(LocalDSA.getGlobalsGraph()); GlobalsGraph->setPrintAuxCalls(); diff --git a/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp b/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp index b2a0f4ba9b8..ee111e9d8fe 100644 --- a/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp +++ b/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp @@ -32,7 +32,7 @@ namespace { // 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(); GlobalsGraph = new DSGraph(BU.getGlobalsGraph()); GlobalsGraph->setPrintAuxCalls(); diff --git a/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp b/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp index 3cff79526f7..6444cc8aeb0 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp +++ b/llvm/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 @@ namespace { // 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(); BU = &getAnalysis(); diff --git a/llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp b/llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp index f7a1ed9af3f..1996aea67d6 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp @@ -25,10 +25,10 @@ namespace { 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(); bool Changed = OptimizeGlobals(M); return Changed; diff --git a/llvm/lib/Analysis/DataStructure/IPModRef.cpp b/llvm/lib/Analysis/DataStructure/IPModRef.cpp index ccc15f74e49..6793b0ecdb4 100644 --- a/llvm/lib/Analysis/DataStructure/IPModRef.cpp +++ b/llvm/lib/Analysis/DataStructure/IPModRef.cpp @@ -374,7 +374,7 @@ void IPModRef::releaseMemory() // 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/llvm/lib/Analysis/DataStructure/IPModRef.h b/llvm/lib/Analysis/DataStructure/IPModRef.h index 4a825dbea3a..f8ac15c1bed 100644 --- a/llvm/lib/Analysis/DataStructure/IPModRef.h +++ b/llvm/lib/Analysis/DataStructure/IPModRef.h @@ -183,7 +183,7 @@ public: /// 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 funcToModRefInfoMap; Module* M; @@ -197,7 +197,7 @@ public: /// 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/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index b21f2f10243..070d03738d9 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/lib/Analysis/DataStructure/Local.cpp @@ -1023,7 +1023,7 @@ void GraphBuilder::mergeInGlobalInitializer(GlobalVariable *GV) { } -bool LocalDataStructures::run(Module &M) { +bool LocalDataStructures::runOnModule(Module &M) { GlobalsGraph = new DSGraph(getAnalysis()); const TargetData &TD = getAnalysis(); diff --git a/llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp b/llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp index 49b6425930d..f6c54fb5bbf 100644 --- a/llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp +++ b/llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp @@ -457,7 +457,7 @@ bool MemoryDepAnalysis::runOnFunction(Function &F) { // 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/llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.h b/llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.h index 570a03b679d..ed21e5f687a 100644 --- a/llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.h +++ b/llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.h @@ -40,7 +40,7 @@ class FunctionModRefInfo; /// 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 funcMap; @@ -63,7 +63,7 @@ public: /// 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/llvm/lib/Analysis/DataStructure/Parallelize.cpp b/llvm/lib/Analysis/DataStructure/Parallelize.cpp index 3dcb05ee064..2bb6c7ff46c 100644 --- a/llvm/lib/Analysis/DataStructure/Parallelize.cpp +++ b/llvm/lib/Analysis/DataStructure/Parallelize.cpp @@ -388,11 +388,11 @@ void FindParallelCalls::visitCallInst(CallInst& CI) { //---------------------------------------------------------------------------- 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 @@ namespace { } -bool Parallelize::run(Module& M) { +bool Parallelize::runOnModule(Module& M) { hash_set parallelFunctions; hash_set safeParallelFunctions; hash_set indirectlyCalled; diff --git a/llvm/lib/Analysis/DataStructure/PgmDependenceGraph.h b/llvm/lib/Analysis/DataStructure/PgmDependenceGraph.h index ec6f927a7e6..d7774943bd9 100644 --- a/llvm/lib/Analysis/DataStructure/PgmDependenceGraph.h +++ b/llvm/lib/Analysis/DataStructure/PgmDependenceGraph.h @@ -200,7 +200,7 @@ public: /// 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 @@ public: /// 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/llvm/lib/Analysis/DataStructure/Steensgaard.cpp b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp index deeb8b34509..b0718a18b97 100644 --- a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/llvm/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 @@ namespace { // 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 @@ void Steens::ResolveFunctionCall(Function *F, const DSCallSite &Call, /// 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(); diff --git a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp index 1d861e8216e..6271980737a 100644 --- a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp +++ b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp @@ -51,7 +51,7 @@ void TDDataStructures::markReachableFunctionsExternallyAccessible(DSNode *N, // 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(); GlobalsGraph = new DSGraph(BU.getGlobalsGraph()); GlobalsGraph->setPrintAuxCalls(); diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp index 7901c91abb3..9ade25e1eed 100644 --- a/llvm/lib/Analysis/IPA/Andersens.cpp +++ b/llvm/lib/Analysis/IPA/Andersens.cpp @@ -75,7 +75,7 @@ namespace { Statistic<> NumIndirectCallees("anders-aa", "Number of indirect callees found"); - class Andersens : public Pass, public AliasAnalysis, + class Andersens : public ModulePass, public AliasAnalysis, private InstVisitor { /// 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 @@ namespace { }; public: - bool run(Module &M) { + bool runOnModule(Module &M) { InitializeAliasAnalysis(this); IdentifyObjects(M); CollectConstraints(M); diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index dbf5b9f95bd..a6d2836121e 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -100,7 +100,7 @@ void CallGraph::addToCallGraph(Function *F) { } } -bool CallGraph::run(Module &M) { +bool CallGraph::runOnModule(Module &M) { destroy(); Mod = &M; diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp index f7d7ab126a3..8eb1c120b0c 100644 --- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -28,7 +28,7 @@ void CallGraphSCCPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); } -bool CallGraphSCCPass::run(Module &M) { +bool CallGraphSCCPass::runOnModule(Module &M) { CallGraph &CG = getAnalysis(); bool Changed = doInitialization(CG); for (scc_iterator I = scc_begin(&CG), E = scc_end(&CG); diff --git a/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp index 23ee99aa59c..c0d0a628501 100644 --- a/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp +++ b/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp @@ -58,7 +58,7 @@ static inline bool isSafeInstruction(const Instruction &I) { } -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/llvm/lib/Analysis/IPA/FindUsedTypes.cpp b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp index 1f127fe82d4..cb6b05ca4ec 100644 --- a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp +++ b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp @@ -58,7 +58,7 @@ void FindUsedTypes::IncorporateValue(const Value *V) { // 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/llvm/lib/Analysis/IPA/GlobalsModRef.cpp b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp index c1f15ed2385..2c4ad4aa4d6 100644 --- a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp @@ -67,7 +67,7 @@ namespace { }; /// 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 NonAddressTakenGlobals; @@ -77,7 +77,7 @@ namespace { std::map 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(), M); // Propagate on CG diff --git a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp index cd3f5753559..333e9e06f78 100644 --- a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp +++ b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp @@ -28,7 +28,7 @@ namespace { 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 @@ namespace { } /// run - Load the profile information from the specified file. - virtual bool run(Module &M); + virtual bool runOnModule(Module &M); }; RegisterOpt @@ -62,7 +62,7 @@ Pass *llvm::createProfileLoaderPass(const std::string &Filename) { 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; -- cgit v1.2.3