X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FIntervalPartition.cpp;h=1f17b77a5b96f91649cfa64c5f9dc4f09bd8bc68;hb=206d61e62f02f5ea5eefdd125dc48ff28f15da4a;hp=a430cffc3580a22799b7255e5ad06d4920c06dee;hpb=9f83512ce80279aa5ff243d4285283438360d015;p=oota-llvm.git diff --git a/lib/Analysis/IntervalPartition.cpp b/lib/Analysis/IntervalPartition.cpp index a430cffc358..1f17b77a5b9 100644 --- a/lib/Analysis/IntervalPartition.cpp +++ b/lib/Analysis/IntervalPartition.cpp @@ -23,15 +23,16 @@ X("intervals", "Interval Partition Construction", true, true); // IntervalPartition Implementation //===----------------------------------------------------------------------===// -// destroy - Reset state back to before function was analyzed -void IntervalPartition::destroy() { +// releaseMemory - Reset state back to before function was analyzed +void IntervalPartition::releaseMemory() { for (unsigned i = 0, e = Intervals.size(); i != e; ++i) delete Intervals[i]; IntervalMap.clear(); + Intervals.clear(); RootInterval = 0; } -void IntervalPartition::print(std::ostream &O, const Module*) const { +void IntervalPartition::print(raw_ostream &O, const Module*) const { for(unsigned i = 0, e = Intervals.size(); i != e; ++i) Intervals[i]->print(O); } @@ -90,9 +91,8 @@ bool IntervalPartition::runOnFunction(Function &F) { // distinguish it from a copy constructor. Always pass in false for now. // IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) - : FunctionPass((intptr_t) &ID) { - Interval *FunctionStart = IP.getRootInterval(); - assert(FunctionStart && "Cannot operate on empty IntervalPartitions!"); + : FunctionPass(&ID) { + assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!"); // Pass false to intervals_begin because we take ownership of it's memory interval_part_interval_iterator I = intervals_begin(IP, false);