Rewrote uses of deprecated `MachineFunction::get(BasicBlock *BB)'.
[oota-llvm.git] / lib / Target / SparcV9 / RegAlloc / LiveRangeInfo.h
index 48e81c10682dba30183a6563ad09bed800b31559..48abdc0da5ab59909d5f9aecdf1343d6c8ba6623 100644 (file)
@@ -1,4 +1,4 @@
-//===-- LiveRangeInfo.h - Track all LiveRanges for a Method ------*- C++ -*-==//
+//===-- LiveRangeInfo.h - Track all LiveRanges for a Function ----*- C++ -*-==//
 //
 // This file contains the class LiveRangeInfo which constructs and keeps 
 // the LiveRangMap which contains all the live ranges used in a method.
@@ -28,11 +28,11 @@ class RegClass;
 class MachineRegInfo;
 class TargetMachine;
 class Value;
-class Method;
+class Function;
 class Instruction;
 
-typedef std::hash_map<const Value*, LiveRange*> LiveRangeMapType;
-typedef std::vector<const MachineInstr*> CallRetInstrListType;
+typedef hash_map<const Value*, LiveRange*> LiveRangeMapType;
+typedef std::vector<MachineInstr*> CallRetInstrListType;
 
 //----------------------------------------------------------------------------
 // Class LiveRangeInfo
@@ -42,7 +42,7 @@ typedef std::vector<const MachineInstr*> CallRetInstrListType;
 //----------------------------------------------------------------------------
 
 class LiveRangeInfo {
-  const Method *const Meth;         // Method for which live range info is held
+  const Function *const Meth;       // Func for which live range info is held
   LiveRangeMapType  LiveRangeMap;   // A map from Value * to LiveRange * to 
                                     // record all live ranges in a method
                                     // created by constructLiveRanges
@@ -58,17 +58,25 @@ class LiveRangeInfo {
 
   //------------ Private methods (see LiveRangeInfo.cpp for description)-------
 
-  void unionAndUpdateLRs(LiveRange *L1, LiveRange *L2);
+  LiveRange* createNewLiveRange         (const Value* Def,
+                                         bool isCC = false);
 
-  void addInterference(const Instruction *Inst, const ValueSet *LVSet);
+  LiveRange* createOrAddToLiveRange     (const Value* Def,
+                                         bool isCC = false);
+
+  void unionAndUpdateLRs                (LiveRange *L1,
+                                         LiveRange *L2);
+
+  void addInterference                  (const Instruction *Inst,
+                                         const ValueSet *LVSet);
   
-  void suggestRegs4CallRets();
+  void suggestRegs4CallRets             ();
 
-  const Method* getMethod() { return Meth; }
+  const Function *getMethod             () const { return Meth; }
 
 public:
   
-  LiveRangeInfo(const Method *M
+  LiveRangeInfo(const Function *F
                const TargetMachine& tm,
                std::vector<RegClass *> & RCList);
 
@@ -79,15 +87,6 @@ public:
   // Main entry point for live range construction
   //
   void constructLiveRanges();
-
-  // This method is used to add a live range created elsewhere (e.g.,
-  // in machine specific code) to the common live range map
-  //
-  inline void addLRToMap(const Value *Val, LiveRange *LR) {
-    assert(Val && LR && "Val/LR is NULL!\n");
-    assert((!LiveRangeMap[Val]) && "LR already set in map");
-    LiveRangeMap[Val] = LR;
-  }
   
   // return the common live range map for this method
   //