aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/IntervalPartition.h
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
commitf57b845547302d24ecb6a9e79d7bc386f761a6c9 (patch)
tree369bc5be013a3a6d0373dbf26820d701e01c5297 /include/llvm/Analysis/IntervalPartition.h
parentf2361c5e5c2917e6f19a55927b221d8671753a40 (diff)
downloadexternal_llvm-f57b845547302d24ecb6a9e79d7bc386f761a6c9.zip
external_llvm-f57b845547302d24ecb6a9e79d7bc386f761a6c9.tar.gz
external_llvm-f57b845547302d24ecb6a9e79d7bc386f761a6c9.tar.bz2
* 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
Diffstat (limited to 'include/llvm/Analysis/IntervalPartition.h')
-rw-r--r--include/llvm/Analysis/IntervalPartition.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/include/llvm/Analysis/IntervalPartition.h b/include/llvm/Analysis/IntervalPartition.h
index 10f5317..d31b5fd 100644
--- a/include/llvm/Analysis/IntervalPartition.h
+++ b/include/llvm/Analysis/IntervalPartition.h
@@ -1,7 +1,7 @@
//===- IntervalPartition.h - Interval partition Calculation ------*- C++ -*--=//
//
// This file contains the declaration of the cfg::IntervalPartition class, which
-// calculates and represents the interval partition of a method, or a
+// calculates and represents the interval partition of a function, or a
// preexisting interval partition.
//
// In this way, the interval partition may be used to reduce a flow graph down
@@ -24,12 +24,12 @@ namespace cfg {
//===----------------------------------------------------------------------===//
//
// IntervalPartition - This class builds and holds an "interval partition" for
-// a method. This partition divides the control flow graph into a set of
+// a function. This partition divides the control flow graph into a set of
// maximal intervals, as defined with the properties above. Intuitively, a
// BasicBlock is a (possibly nonexistent) loop with a "tail" of non looping
// nodes following it.
//
-class IntervalPartition : public MethodPass, public std::vector<Interval*> {
+class IntervalPartition : public FunctionPass, public std::vector<Interval*> {
typedef std::map<BasicBlock*, Interval*> IntervalMapTy;
IntervalMapTy IntervalMap;
@@ -41,8 +41,8 @@ public:
IntervalPartition(AnalysisID AID) : RootInterval(0) { assert(AID == ID); }
- // run - Calculate the interval partition for this method
- virtual bool runOnMethod(Function *F);
+ // run - Calculate the interval partition for this function
+ virtual bool runOnFunction(Function *F);
// IntervalPartition ctor - Build a reduced interval partition from an
// existing interval graph. This takes an additional boolean parameter to
@@ -54,7 +54,7 @@ public:
~IntervalPartition() { destroy(); }
// getRootInterval() - Return the root interval that contains the starting
- // block of the method.
+ // block of the function.
inline Interval *getRootInterval() { return RootInterval; }
// isDegeneratePartition() - Returns true if the interval partition contains
@@ -69,15 +69,14 @@ public:
return I != IntervalMap.end() ? I->second : 0;
}
- // getAnalysisUsageInfo - Implement the Pass API
- virtual void getAnalysisUsageInfo(AnalysisSet &Required,
- AnalysisSet &Destroyed,
- AnalysisSet &Provided) {
- Provided.push_back(ID);
+ // getAnalysisUsage - Implement the Pass API
+ virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.setPreservesAll();
+ AU.addProvided(ID);
}
private:
- // destroy - Reset state back to before method was analyzed
+ // destroy - Reset state back to before function was analyzed
void destroy();
// addIntervalToPartition - Add an interval to the internal list of intervals,