aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/Sparc/SparcFrameLowering.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/Target/Sparc/SparcFrameLowering.cpp b/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
index 63187fdce999..d165052ca512 100644
--- a/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
+++ b/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
@@ -97,14 +97,9 @@ void SparcFrameLowering::emitPrologue(MachineFunction &MF,
// Debug location must be unknown since the first debug location is used
// to determine the end of the prologue.
DebugLoc dl;
- bool NeedsStackRealignment = RegInfo.needsStackRealignment(MF);
-
- // FIXME: unfortunately, returning false from canRealignStack
- // actually just causes needsStackRealignment to return false,
- // rather than reporting an error, as would be sensible. This is
- // poor, but fixing that bogosity is going to be a large project.
- // For now, just see if it's lied, and report an error here.
- if (!NeedsStackRealignment && MFI.getMaxAlign() > getStackAlign())
+ bool NeedsStackRealignment = RegInfo.shouldRealignStack(MF);
+
+ if (NeedsStackRealignment && !RegInfo.canRealignStack(MF))
report_fatal_error("Function \"" + Twine(MF.getName()) + "\" required "
"stack re-alignment, but LLVM couldn't handle it "
"(probably because it has a dynamic alloca).");
@@ -252,9 +247,8 @@ bool SparcFrameLowering::hasFP(const MachineFunction &MF) const {
const MachineFrameInfo &MFI = MF.getFrameInfo();
return MF.getTarget().Options.DisableFramePointerElim(MF) ||
- RegInfo->needsStackRealignment(MF) ||
- MFI.hasVarSizedObjects() ||
- MFI.isFrameAddressTaken();
+ RegInfo->hasStackRealignment(MF) || MFI.hasVarSizedObjects() ||
+ MFI.isFrameAddressTaken();
}
StackOffset
@@ -280,7 +274,7 @@ SparcFrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI,
} else if (isFixed) {
// Otherwise, argument access should always use %fp.
UseFP = true;
- } else if (RegInfo->needsStackRealignment(MF)) {
+ } else if (RegInfo->hasStackRealignment(MF)) {
// If there is dynamic stack realignment, all local object
// references need to be via %sp, to take account of the
// re-alignment.