mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Added a MRegisterInfo hook that tells PEI the target is responsible for
rounding the stack frame to a multiple of stack alignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33504 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b9329e01a4
commit
02a2029141
@ -367,6 +367,12 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// targetHandlesStackFrameRounding - Returns true if the target is responsible
|
||||||
|
/// for rounding up the stack frame (probably at emitPrologue time).
|
||||||
|
virtual bool targetHandlesStackFrameRounding() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// hasFP - Return true if the specified function should have a dedicated frame
|
/// hasFP - Return true if the specified function should have a dedicated frame
|
||||||
/// pointer register. For most targets this is true only if the function has
|
/// pointer register. For most targets this is true only if the function has
|
||||||
/// variable sized allocas or if frame pointer elimination is disabled.
|
/// variable sized allocas or if frame pointer elimination is disabled.
|
||||||
|
@ -389,11 +389,12 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
|
|||||||
// Round up the size to a multiple of the alignment, but only if there are
|
// Round up the size to a multiple of the alignment, but only if there are
|
||||||
// calls or alloca's in the function. This ensures that any calls to
|
// calls or alloca's in the function. This ensures that any calls to
|
||||||
// subroutines have their stack frames suitable aligned.
|
// subroutines have their stack frames suitable aligned.
|
||||||
if (FFI->hasCalls() || FFI->hasVarSizedObjects()) {
|
const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo();
|
||||||
|
if (!RegInfo->targetHandlesStackFrameRounding() &&
|
||||||
|
(FFI->hasCalls() || FFI->hasVarSizedObjects())) {
|
||||||
// When we have no frame pointer, we reserve argument space for call sites
|
// When we have no frame pointer, we reserve argument space for call sites
|
||||||
// in the function immediately on entry to the current function. This
|
// in the function immediately on entry to the current function. This
|
||||||
// eliminates the need for add/sub sp brackets around call sites.
|
// eliminates the need for add/sub sp brackets around call sites.
|
||||||
const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo();
|
|
||||||
if (!RegInfo->hasFP(Fn))
|
if (!RegInfo->hasFP(Fn))
|
||||||
Offset += FFI->getMaxCallFrameSize();
|
Offset += FFI->getMaxCallFrameSize();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user