mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-08 03:30:22 +00:00
simplify some overly general code. The stack always grows down on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98431 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e17245dbe9
commit
464bee191f
@ -938,10 +938,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
|
|||||||
std::vector<MachineMove> &Moves = MMI->getFrameMoves();
|
std::vector<MachineMove> &Moves = MMI->getFrameMoves();
|
||||||
const TargetData *TD = MF.getTarget().getTargetData();
|
const TargetData *TD = MF.getTarget().getTargetData();
|
||||||
uint64_t NumBytes = 0;
|
uint64_t NumBytes = 0;
|
||||||
int stackGrowth =
|
int stackGrowth = -TD->getPointerSize();
|
||||||
(MF.getTarget().getFrameInfo()->getStackGrowthDirection() ==
|
|
||||||
TargetFrameInfo::StackGrowsUp ?
|
|
||||||
TD->getPointerSize() : -TD->getPointerSize());
|
|
||||||
|
|
||||||
if (HasFP) {
|
if (HasFP) {
|
||||||
// Calculate required stack adjustment.
|
// Calculate required stack adjustment.
|
||||||
@ -978,8 +975,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change the rule for the FramePtr to be an "offset" rule.
|
// Change the rule for the FramePtr to be an "offset" rule.
|
||||||
MachineLocation FPDst(MachineLocation::VirtualFP,
|
MachineLocation FPDst(MachineLocation::VirtualFP, 2 * stackGrowth);
|
||||||
2 * stackGrowth);
|
|
||||||
MachineLocation FPSrc(FramePtr);
|
MachineLocation FPSrc(FramePtr);
|
||||||
Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc));
|
Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user