mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Use MachineFrameInfo::hasCalls instead of MipsFunctionInfo::hasCall to check if
a function has any function calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132140 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -279,7 +279,6 @@ void MipsFrameLowering::
|
|||||||
processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||||
RegScavenger *RS) const {
|
RegScavenger *RS) const {
|
||||||
MachineRegisterInfo& MRI = MF.getRegInfo();
|
MachineRegisterInfo& MRI = MF.getRegInfo();
|
||||||
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
|
|
||||||
|
|
||||||
// FIXME: remove this code if register allocator can correctly mark
|
// FIXME: remove this code if register allocator can correctly mark
|
||||||
// $fp and $ra used or unused.
|
// $fp and $ra used or unused.
|
||||||
@ -293,7 +292,7 @@ processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
|||||||
// instructions to save/restore $ra unless there is a function call.
|
// instructions to save/restore $ra unless there is a function call.
|
||||||
// To correct this, $ra is explicitly marked unused if there is no
|
// To correct this, $ra is explicitly marked unused if there is no
|
||||||
// function call.
|
// function call.
|
||||||
if (MipsFI->hasCall())
|
if (MF.getFrameInfo()->hasCalls())
|
||||||
MRI.setPhysRegUsed(Mips::RA);
|
MRI.setPhysRegUsed(Mips::RA);
|
||||||
else
|
else
|
||||||
MRI.setPhysRegUnused(Mips::RA);
|
MRI.setPhysRegUnused(Mips::RA);
|
||||||
|
@ -1171,8 +1171,6 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||||||
SmallVector<std::pair<unsigned, SDValue>, 16> RegsToPass;
|
SmallVector<std::pair<unsigned, SDValue>, 16> RegsToPass;
|
||||||
SmallVector<SDValue, 8> MemOpChains;
|
SmallVector<SDValue, 8> MemOpChains;
|
||||||
|
|
||||||
MipsFI->setHasCall();
|
|
||||||
|
|
||||||
// If this is the first call, create a stack frame object that points to
|
// If this is the first call, create a stack frame object that points to
|
||||||
// a location to which .cprestore saves $gp. The offset of this frame object
|
// a location to which .cprestore saves $gp. The offset of this frame object
|
||||||
// is set to 0, since we know nothing about the size of the argument area at
|
// is set to 0, since we know nothing about the size of the argument area at
|
||||||
|
@ -47,14 +47,12 @@ private:
|
|||||||
// LowerCall except for the frame object for restoring $gp.
|
// LowerCall except for the frame object for restoring $gp.
|
||||||
std::pair<int, int> InArgFIRange, OutArgFIRange;
|
std::pair<int, int> InArgFIRange, OutArgFIRange;
|
||||||
int GPFI; // Index of the frame object for restoring $gp
|
int GPFI; // Index of the frame object for restoring $gp
|
||||||
bool HasCall; // True if function has a function call.
|
|
||||||
unsigned MaxCallFrameSize;
|
unsigned MaxCallFrameSize;
|
||||||
public:
|
public:
|
||||||
MipsFunctionInfo(MachineFunction& MF)
|
MipsFunctionInfo(MachineFunction& MF)
|
||||||
: SRetReturnReg(0), GlobalBaseReg(0),
|
: SRetReturnReg(0), GlobalBaseReg(0),
|
||||||
VarArgsFrameIndex(0), InArgFIRange(std::make_pair(-1, 0)),
|
VarArgsFrameIndex(0), InArgFIRange(std::make_pair(-1, 0)),
|
||||||
OutArgFIRange(std::make_pair(-1, 0)), GPFI(0), HasCall(false),
|
OutArgFIRange(std::make_pair(-1, 0)), GPFI(0), MaxCallFrameSize(0)
|
||||||
MaxCallFrameSize(0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool isInArgFI(int FI) const {
|
bool isInArgFI(int FI) const {
|
||||||
@ -86,9 +84,6 @@ public:
|
|||||||
int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
|
int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
|
||||||
void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
|
void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
|
||||||
|
|
||||||
bool hasCall() const { return HasCall; }
|
|
||||||
void setHasCall() { HasCall = true; }
|
|
||||||
|
|
||||||
unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
|
unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
|
||||||
void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
|
void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user