Re-apply LiveInterval index dumping patch, with fixes suggested by Bill
[oota-llvm.git] / include / llvm / CodeGen / MachineFunction.h
index ea6a384d2287243b3f93fda831d8ad36abd233bc..57c946c789a9d1a85783af4060dd1e38a952606c 100644 (file)
@@ -20,8 +20,8 @@
 
 #include "llvm/ADT/ilist.h"
 #include "llvm/Support/DebugLoc.h"
+#include "llvm/CodeGen/Dump.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/Support/Annotation.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Recycler.h"
 
@@ -66,8 +66,8 @@ struct MachineFunctionInfo {
   virtual ~MachineFunctionInfo() {}
 };
 
-class MachineFunction : private Annotation {
-  const Function *Fn;
+class MachineFunction {
+  Function *Fn;
   const TargetMachine &Target;
 
   // RegInfo - Information about each register in use in the function.
@@ -115,12 +115,12 @@ class MachineFunction : private Annotation {
   unsigned Alignment;
 
 public:
-  MachineFunction(const Function *Fn, const TargetMachine &TM);
+  MachineFunction(Function *Fn, const TargetMachine &TM);
   ~MachineFunction();
 
   /// getFunction - Return the LLVM function that this machine code represents
   ///
-  const Function *getFunction() const { return Fn; }
+  Function *getFunction() const { return Fn; }
 
   /// getTarget - Return the target machine this machine code is compiled with
   ///
@@ -207,8 +207,12 @@ public:
   /// print - Print out the MachineFunction in a format suitable for debugging
   /// to the specified stream.
   ///
-  void print(std::ostream &OS) const;
-  void print(std::ostream *OS) const { if (OS) print(*OS); }
+  void print(std::ostream &OS, 
+             const PrefixPrinter &prefix = PrefixPrinter()) const;
+  void print(std::ostream *OS,
+             const PrefixPrinter &prefix = PrefixPrinter()) const {
+    if (OS) print(*OS, prefix); 
+  }
 
   /// viewCFG - This function is meant for use from the debugger.  You can just
   /// say 'call F->viewCFG()' and a ghostview window should pop up from the
@@ -229,21 +233,6 @@ public:
   ///
   void dump() const;
 
-  /// construct - Allocate and initialize a MachineFunction for a given Function
-  /// and Target
-  ///
-  static MachineFunction& construct(const Function *F, const TargetMachine &TM);
-
-  /// destruct - Destroy the MachineFunction corresponding to a given Function
-  ///
-  static void destruct(const Function *F);
-
-  /// get - Return a handle to a MachineFunction corresponding to the given
-  /// Function.  This should not be called before "construct()" for a given
-  /// Function.
-  ///
-  static MachineFunction& get(const Function *F);
-
   // Provide accessors for the MachineBasicBlock list...
   typedef BasicBlockListType::iterator iterator;
   typedef BasicBlockListType::const_iterator const_iterator;