Rewrote uses of deprecated `MachineFunction::get(BasicBlock *BB)'.
[oota-llvm.git] / lib / Target / SparcV9 / RegAlloc / PhyRegAlloc.h
index 3c4f98a8b959749d135f6fd893779739e7d63d1d..12f0bf05ebf00c23265ed9fdfd070e249b78958b 100644 (file)
 
 #include "llvm/CodeGen/RegClass.h"
 #include "llvm/CodeGen/LiveRangeInfo.h"
-#include <deque>
-class MachineCodeForMethod;
+#include <vector>
+#include <map>
+
+class MachineFunction;
 class MachineRegInfo;
 class FunctionLiveVarInfo;
 class MachineInstr;
@@ -49,8 +51,8 @@ class LoopInfo;
 //----------------------------------------------------------------------------
 
 struct AddedInstrns {
-  std::deque<MachineInstr*> InstrnsBefore;// Added insts BEFORE an existing inst
-  std::deque<MachineInstr*> InstrnsAfter; // Added insts AFTER an existing inst
+  std::vector<MachineInstr*> InstrnsBefore;//Insts added BEFORE an existing inst
+  std::vector<MachineInstr*> InstrnsAfter; //Insts added AFTER an existing inst
 };
 
 typedef std::map<const MachineInstr *, AddedInstrns> AddedInstrMapType;
@@ -68,8 +70,8 @@ class PhyRegAlloc: public NonCopyable {
 
   std::vector<RegClass *> RegClassList; // vector of register classes
   const TargetMachine &TM;              // target machine
-  const Function *Meth;                 // name of the function we work on
-  MachineCodeForMethod &mcInfo;         // descriptor for method's native code
+  const Function *Fn;                   // name of the function we work on
+  MachineFunction &MF;                  // descriptor for method's native code
   FunctionLiveVarInfo *const LVI;       // LV information for this method 
                                         // (already computed for BBs) 
   LiveRangeInfo LRI;                    // LR info  (will be computed)
@@ -141,13 +143,14 @@ private:
   friend class UltraSparcRegInfo;
 
 
-  int getUsableUniRegAtMI(RegClass *RC, int RegType, 
-                         const MachineInstr *MInst,
-                         const ValueSet *LVSetBef, MachineInstr *&MIBef, 
-                         MachineInstr *&MIAft );
-
+  int getUsableUniRegAtMI(int RegType, 
+                         const ValueSet *LVSetBef,
+                         MachineInstr *MInst,
+                          std::vector<MachineInstr*>& MIBef,
+                          std::vector<MachineInstr*>& MIAft);
+  
   int getUnusedUniRegAtMI(RegClass *RC,  const MachineInstr *MInst, 
-                      const ValueSet *LVSetBef);
+                          const ValueSet *LVSetBef);
 
   void setRelRegsUsedByThisInst(RegClass *RC, const MachineInstr *MInst );
   int getUniRegNotUsedByThisInst(RegClass *RC, const MachineInstr *MInst);