mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-23 01:30:19 +00:00
Change initial value of MaxCallFrameSize. MipsFI::getMaxCallFrameSize() should
return 0 if there are no function calls made. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
edacba83dc
commit
f15f498507
@ -154,7 +154,7 @@ void MipsFrameLowering::emitPrologue(MachineFunction &MF) const {
|
|||||||
unsigned StackAlign = getStackAlignment();
|
unsigned StackAlign = getStackAlignment();
|
||||||
unsigned LocalVarAreaOffset = MipsFI->needGPSaveRestore() ?
|
unsigned LocalVarAreaOffset = MipsFI->needGPSaveRestore() ?
|
||||||
(MFI->getObjectOffset(MipsFI->getGPFI()) + RegSize) :
|
(MFI->getObjectOffset(MipsFI->getGPFI()) + RegSize) :
|
||||||
MFI->getMaxCallFrameSize();
|
MipsFI->getMaxCallFrameSize();
|
||||||
unsigned StackSize = AlignOffset(LocalVarAreaOffset, StackAlign) +
|
unsigned StackSize = AlignOffset(LocalVarAreaOffset, StackAlign) +
|
||||||
AlignOffset(MFI->getStackSize(), StackAlign);
|
AlignOffset(MFI->getStackSize(), StackAlign);
|
||||||
|
|
||||||
|
@ -1322,7 +1322,7 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||||||
if (IsPIC) {
|
if (IsPIC) {
|
||||||
// Function can have an arbitrary number of calls, so
|
// Function can have an arbitrary number of calls, so
|
||||||
// hold the LastArgStackLoc with the biggest offset.
|
// hold the LastArgStackLoc with the biggest offset.
|
||||||
int MaxCallFrameSize = MipsFI->getMaxCallFrameSize();
|
unsigned MaxCallFrameSize = MipsFI->getMaxCallFrameSize();
|
||||||
unsigned NextStackOffset = CCInfo.getNextStackOffset();
|
unsigned NextStackOffset = CCInfo.getNextStackOffset();
|
||||||
|
|
||||||
// For O32, a minimum of four words (16 bytes) of argument space is
|
// For O32, a minimum of four words (16 bytes) of argument space is
|
||||||
@ -1330,7 +1330,7 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||||||
if (Subtarget->isABI_O32())
|
if (Subtarget->isABI_O32())
|
||||||
NextStackOffset = std::max(NextStackOffset, (unsigned)16);
|
NextStackOffset = std::max(NextStackOffset, (unsigned)16);
|
||||||
|
|
||||||
if (MaxCallFrameSize < (int)NextStackOffset) {
|
if (MaxCallFrameSize < NextStackOffset) {
|
||||||
MipsFI->setMaxCallFrameSize(NextStackOffset);
|
MipsFI->setMaxCallFrameSize(NextStackOffset);
|
||||||
|
|
||||||
// $gp restore slot must be aligned.
|
// $gp restore slot must be aligned.
|
||||||
|
@ -48,13 +48,13 @@ private:
|
|||||||
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.
|
bool HasCall; // True if function has a function call.
|
||||||
int 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), HasCall(false),
|
||||||
MaxCallFrameSize(-1)
|
MaxCallFrameSize(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool isInArgFI(int FI) const {
|
bool isInArgFI(int FI) const {
|
||||||
@ -89,8 +89,8 @@ public:
|
|||||||
bool hasCall() const { return HasCall; }
|
bool hasCall() const { return HasCall; }
|
||||||
void setHasCall() { HasCall = true; }
|
void setHasCall() { HasCall = true; }
|
||||||
|
|
||||||
int getMaxCallFrameSize() const { return MaxCallFrameSize; }
|
unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
|
||||||
void setMaxCallFrameSize(int S) { MaxCallFrameSize = S; }
|
void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace llvm
|
} // end of namespace llvm
|
||||||
|
Loading…
Reference in New Issue
Block a user