#include "llvm/CodeGen/RegClass.h"
#include "llvm/CodeGen/LiveRangeInfo.h"
-#include "llvm/Analysis/LoopDepth.h"
#include <deque>
class MachineCodeForMethod;
class MachineRegInfo;
class MethodLiveVarInfo;
class MachineInstr;
+namespace cfg { class LoopDepthCalculator; }
//----------------------------------------------------------------------------
// Class AddedInstrns:
//----------------------------------------------------------------------------
-class PhyRegAlloc: public NonCopyable
-{
+class PhyRegAlloc: public NonCopyable {
std::vector<RegClass *> RegClassList; // vector of register classes
const TargetMachine &TM; // target machine
AddedInstrMapType AddedInstrMap; // to store instrns added in this phase
- cfg::LoopDepthCalculator LoopDepthCalc; // to calculate loop depths
+ cfg::LoopDepthCalculator *LoopDepthCalc; // to calculate loop depths
ReservedColorListType ResColList; // A set of reserved regs if desired.
// currently not used
+public:
+ PhyRegAlloc(Method *M, const TargetMachine& TM, MethodLiveVarInfo *Lvi,
+ cfg::LoopDepthCalculator *LoopDepthCalc);
+ ~PhyRegAlloc();
+
+ // main method called for allocating registers
+ //
+ void allocateRegisters();
+private:
+
//------- ------------------ private methods---------------------------------
int getUniRegNotUsedByThisInst(RegClass *RC, const MachineInstr *MInst);
void addInterf4PseudoInstr(const MachineInstr *MInst);
-
- public:
- PhyRegAlloc(Method *const M, const TargetMachine& TM,
- MethodLiveVarInfo *const Lvi);
- ~PhyRegAlloc();
-
- // main method called for allocating registers
- //
- void allocateRegisters();
-
};
#include "llvm/CodeGen/RegClass.h"
#include "llvm/CodeGen/LiveRangeInfo.h"
-#include "llvm/Analysis/LoopDepth.h"
#include <deque>
class MachineCodeForMethod;
class MachineRegInfo;
class MethodLiveVarInfo;
class MachineInstr;
+namespace cfg { class LoopDepthCalculator; }
//----------------------------------------------------------------------------
// Class AddedInstrns:
//----------------------------------------------------------------------------
-class PhyRegAlloc: public NonCopyable
-{
+class PhyRegAlloc: public NonCopyable {
std::vector<RegClass *> RegClassList; // vector of register classes
const TargetMachine &TM; // target machine
AddedInstrMapType AddedInstrMap; // to store instrns added in this phase
- cfg::LoopDepthCalculator LoopDepthCalc; // to calculate loop depths
+ cfg::LoopDepthCalculator *LoopDepthCalc; // to calculate loop depths
ReservedColorListType ResColList; // A set of reserved regs if desired.
// currently not used
+public:
+ PhyRegAlloc(Method *M, const TargetMachine& TM, MethodLiveVarInfo *Lvi,
+ cfg::LoopDepthCalculator *LoopDepthCalc);
+ ~PhyRegAlloc();
+
+ // main method called for allocating registers
+ //
+ void allocateRegisters();
+private:
+
//------- ------------------ private methods---------------------------------
int getUniRegNotUsedByThisInst(RegClass *RC, const MachineInstr *MInst);
void addInterf4PseudoInstr(const MachineInstr *MInst);
-
- public:
- PhyRegAlloc(Method *const M, const TargetMachine& TM,
- MethodLiveVarInfo *const Lvi);
- ~PhyRegAlloc();
-
- // main method called for allocating registers
- //
- void allocateRegisters();
-
};