summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-27 06:56:12 +0000
committerChris Lattner <sabre@nondot.org>2002-04-27 06:56:12 +0000
commitc8e665431be235941eedfd0e6434fa5386d632d1 (patch)
treeec509bce054e36357111e58ecd2207fcc8238b9b /llvm/lib/Analysis
parent66cfaf1da24e732948b75d1d82272793da8ec5ae (diff)
downloadbcm5719-llvm-c8e665431be235941eedfd0e6434fa5386d632d1.tar.gz
bcm5719-llvm-c8e665431be235941eedfd0e6434fa5386d632d1.zip
* 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 llvm-svn: 2333
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp8
-rw-r--r--llvm/lib/Analysis/IPA/FindUsedTypes.cpp8
-rw-r--r--llvm/lib/Analysis/IntervalPartition.cpp10
-rw-r--r--llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp12
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp11
-rw-r--r--llvm/lib/Analysis/PostDominators.cpp17
6 files changed, 24 insertions, 42 deletions
diff --git a/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
index d689d93cd44..9f908c6c716 100644
--- a/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
+++ b/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
@@ -95,11 +95,3 @@ void FindUnsafePointerTypes::printResults(const Module *M,
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/llvm/lib/Analysis/IPA/FindUsedTypes.cpp b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
index 5c961d2bebe..86061d8610c 100644
--- a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -93,11 +93,3 @@ void FindUsedTypes::printTypes(std::ostream &o, const Module *M = 0) const {
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/llvm/lib/Analysis/IntervalPartition.cpp b/llvm/lib/Analysis/IntervalPartition.cpp
index 197bed26d79..bb0f5821081 100644
--- a/llvm/lib/Analysis/IntervalPartition.cpp
+++ b/llvm/lib/Analysis/IntervalPartition.cpp
@@ -52,19 +52,19 @@ void IntervalPartition::updatePredecessors(cfg::Interval *Int) {
// 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/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
index e9e4245cca6..0518aef3b8c 100644
--- a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
+++ b/llvm/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 @@ const ValueSet &MethodLiveVarInfo::getInSetOfBB(const BasicBlock *BB) const {
//-----------------------------------------------------------------------------
-// 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 @@ void MethodLiveVarInfo::releaseMemory() {
//-----------------------------------------------------------------------------
// 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/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index ef47936bbae..c34aef7b9c7 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -35,7 +35,7 @@ void cfg::LoopInfo::releaseMemory() {
//===----------------------------------------------------------------------===//
// 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 @@ void cfg::LoopInfo::Calculate(const DominatorSet &DS) {
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/llvm/lib/Analysis/PostDominators.cpp b/llvm/lib/Analysis/PostDominators.cpp
index 71ee3d74cf9..387b673f606 100644
--- a/llvm/lib/Analysis/PostDominators.cpp
+++ b/llvm/lib/Analysis/PostDominators.cpp
@@ -22,7 +22,7 @@ using std::set;
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 @@ void cfg::DominatorSet::calcPostDominatorSet(Function *M) {
} 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);
}
}
OpenPOWER on IntegriCloud