FixGlobalBaseReg("mips-fix-global-base-reg", cl::Hidden, cl::init(true),
cl::desc("Always use $gp as the global base register."));
-bool MipsFunctionInfo::globalBaseRegFixed() const {
- return FixGlobalBaseReg;
-}
-
bool MipsFunctionInfo::globalBaseRegSet() const {
return GlobalBaseReg;
}
const MipsSubtarget &ST = MF.getTarget().getSubtarget<MipsSubtarget>();
- if (FixGlobalBaseReg && ST.isABI_O32()) // $gp is the global base register.
- return GlobalBaseReg = Mips::GP;
-
const TargetRegisterClass *RC = ST.isABI_N64() ?
(const TargetRegisterClass*)&Mips::CPU64RegsRegClass :
(const TargetRegisterClass*)&Mips::CPURegsRegClass;
// OutArgFIRange: Range of indices of all frame objects created during call to
// LowerCall except for the frame object for restoring $gp.
std::pair<int, int> InArgFIRange, OutArgFIRange;
- int GPFI; // Index of the frame object for restoring $gp
mutable int DynAllocFI; // Frame index of dynamically allocated stack area.
unsigned MaxCallFrameSize;
MipsFunctionInfo(MachineFunction& MF)
: MF(MF), SRetReturnReg(0), GlobalBaseReg(0),
VarArgsFrameIndex(0), InArgFIRange(std::make_pair(-1, 0)),
- OutArgFIRange(std::make_pair(-1, 0)), GPFI(0), DynAllocFI(0),
+ OutArgFIRange(std::make_pair(-1, 0)), DynAllocFI(0),
MaxCallFrameSize(0), EmitNOAT(false)
{}
OutArgFIRange.second = LastFI;
}
- int getGPFI() const { return GPFI; }
- void setGPFI(int FI) { GPFI = FI; }
- bool needGPSaveRestore() const { return getGPFI(); }
- bool isGPFI(int FI) const { return GPFI && GPFI == FI; }
-
// The first call to this function creates a frame object for dynamically
// allocated stack area.
int getDynAllocFI() const {
unsigned getSRetReturnReg() const { return SRetReturnReg; }
void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
- bool globalBaseRegFixed() const;
bool globalBaseRegSet() const;
unsigned getGlobalBaseReg();