From ccf571a408aacb589304f59c544fcdd75b7009ba Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 31 Jan 2002 00:42:27 +0000 Subject: Convert analyses to new pass structure llvm-svn: 1603 --- llvm/lib/Analysis/IntervalPartition.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Analysis/IntervalPartition.cpp') diff --git a/llvm/lib/Analysis/IntervalPartition.cpp b/llvm/lib/Analysis/IntervalPartition.cpp index fff8d224e21..f524d016f16 100644 --- a/llvm/lib/Analysis/IntervalPartition.cpp +++ b/llvm/lib/Analysis/IntervalPartition.cpp @@ -11,13 +11,17 @@ using namespace cfg; using std::make_pair; +AnalysisID IntervalPartition::ID(AnalysisID::create()); + //===----------------------------------------------------------------------===// // IntervalPartition Implementation //===----------------------------------------------------------------------===// -// Destructor - Free memory -IntervalPartition::~IntervalPartition() { +// destroy - Reset state back to before method was analyzed +void IntervalPartition::destroy() { for_each(begin(), end(), deleter); + IntervalMap.clear(); + RootInterval = 0; } // addIntervalToPartition - Add an interval to the internal list of intervals, @@ -48,7 +52,7 @@ void IntervalPartition::updatePredecessors(cfg::Interval *Int) { // IntervalPartition ctor - Build the first level interval partition for the // specified method... // -IntervalPartition::IntervalPartition(Method *M) { +bool IntervalPartition::runOnMethod(Method *M) { assert(M->front() && "Cannot operate on prototypes!"); // Pass false to intervals_begin because we take ownership of it's memory @@ -67,6 +71,7 @@ IntervalPartition::IntervalPartition(Method *M) { // predecessors for each block... for_each(begin(), end(), bind_obj(this, &IntervalPartition::updatePredecessors)); + return false; } -- cgit v1.2.3