summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-09-20 04:48:05 +0000
committerChris Lattner <sabre@nondot.org>2004-09-20 04:48:05 +0000
commit4f2cf030e899f5fea5c2760326c853e89a2e8235 (patch)
tree88ec23feccde977902434fd327c6d95671c475fe /llvm/lib/Analysis
parent79e523de04b67fc0fbc73baf6605707b7aa91e65 (diff)
downloadbcm5719-llvm-4f2cf030e899f5fea5c2760326c853e89a2e8235.tar.gz
bcm5719-llvm-4f2cf030e899f5fea5c2760326c853e89a2e8235.zip
'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
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/AliasAnalysisCounter.cpp4
-rw-r--r--llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp2
-rw-r--r--llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp2
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructureAA.cpp4
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp4
-rw-r--r--llvm/lib/Analysis/DataStructure/IPModRef.cpp2
-rw-r--r--llvm/lib/Analysis/DataStructure/IPModRef.h4
-rw-r--r--llvm/lib/Analysis/DataStructure/Local.cpp2
-rw-r--r--llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.cpp2
-rw-r--r--llvm/lib/Analysis/DataStructure/MemoryDepAnalysis.h4
-rw-r--r--llvm/lib/Analysis/DataStructure/Parallelize.cpp6
-rw-r--r--llvm/lib/Analysis/DataStructure/PgmDependenceGraph.h4
-rw-r--r--llvm/lib/Analysis/DataStructure/Steensgaard.cpp6
-rw-r--r--llvm/lib/Analysis/DataStructure/TopDownClosure.cpp2
-rw-r--r--llvm/lib/Analysis/IPA/Andersens.cpp4
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp2
-rw-r--r--llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp2
-rw-r--r--llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp2
-rw-r--r--llvm/lib/Analysis/IPA/FindUsedTypes.cpp2
-rw-r--r--llvm/lib/Analysis/IPA/GlobalsModRef.cpp4
-rw-r--r--llvm/lib/Analysis/ProfileInfoLoaderPass.cpp6
21 files changed, 35 insertions, 35 deletions
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<Pass*>(&getAnalysis<AliasAnalysis>())->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<LocalDataStructures>();
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<BUDataStructures>();
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<TDDataStructures>();
BU = &getAnalysis<BUDataStructures>();
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<TDDataStructures>();
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<const Function*, FunctionModRefInfo*> 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<TargetData>());
const TargetData &TD = getAnalysis<TargetData>();
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<Function*, DependenceGraph*> 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<Function*> parallelFunctions;
hash_set<Function*> safeParallelFunctions;
hash_set<const GlobalValue*> 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<LocalDataStructures>();
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<BUDataStructures>();
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<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 @@ 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<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/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<GlobalValue*> NonAddressTakenGlobals;
@@ -77,7 +77,7 @@ namespace {
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/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<LoaderPass>
@@ -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;
OpenPOWER on IntegriCloud