Drop Loop::isNotAlreadyContainedIn in favor of Loop::contains. The
[oota-llvm.git] / include / llvm / Analysis / IntervalPartition.h
index b03ac1f9726c491efed68512e4db75b7d1cdbe14..c1214e7427a4a4b2a9205992d06e9a3374157482 100644 (file)
@@ -1,5 +1,12 @@
 //===- IntervalPartition.h - Interval partition Calculation -----*- C++ -*-===//
 //
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
 // This file contains the declaration of the IntervalPartition class, which
 // calculates and represents the interval partition of a function, or a
 // preexisting interval partition.
@@ -18,6 +25,9 @@
 
 #include "llvm/Analysis/Interval.h"
 #include "llvm/Pass.h"
+#include <map>
+
+namespace llvm {
 
 //===----------------------------------------------------------------------===//
 //
@@ -36,7 +46,9 @@ class IntervalPartition : public FunctionPass {
   std::vector<Interval*> Intervals;
 
 public:
-  IntervalPartition() : RootInterval(0) {}
+  static char ID; // Pass identification, replacement for typeid
+
+  IntervalPartition() : FunctionPass(&ID), RootInterval(0) {}
 
   // run - Calculate the interval partition for this function
   virtual bool runOnFunction(Function &F);
@@ -47,11 +59,8 @@ public:
   //
   IntervalPartition(IntervalPartition &I, bool);
 
-  // Destructor - Free memory
-  ~IntervalPartition() { destroy(); }
-
   // print - Show contents in human readable format...
-  virtual void print(std::ostream &O) const;
+  virtual void print(raw_ostream &O, const Module* = 0) const;
 
   // getRootInterval() - Return the root interval that contains the starting
   // block of the function.
@@ -77,10 +86,10 @@ public:
   // Interface to Intervals vector...
   const std::vector<Interval*> &getIntervals() const { return Intervals; }
 
-private:
-  // destroy - Reset state back to before function was analyzed
-  void destroy();
+  // releaseMemory - Reset state back to before function was analyzed
+  void releaseMemory();
 
+private:
   // addIntervalToPartition - Add an interval to the internal list of intervals,
   // and then add mappings from all of the basic blocks in the interval to the
   // interval itself (in the IntervalMap).
@@ -95,4 +104,6 @@ private:
   void updatePredecessors(Interval *Int);
 };
 
+} // End llvm namespace
+
 #endif