summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp
diff options
context:
space:
mode:
authorVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>2015-11-12 13:04:16 +0000
committerVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>2015-11-12 13:04:16 +0000
commit352eb55baf82ed0a0738a4d3558ce5b8ab821888 (patch)
treef939ace0649226a0e46d7e18b06b619001ff3f0d /llvm/lib/Target/Mips/MipsSEFrameLowering.cpp
parent2d09c00b918c29cf3e581459eed1946987357722 (diff)
downloadbcm5719-llvm-352eb55baf82ed0a0738a4d3558ce5b8ab821888.tar.gz
bcm5719-llvm-352eb55baf82ed0a0738a4d3558ce5b8ab821888.zip
[mips] Use correct frame register for DWARF info when dynamically realigning the stack.
Summary: This patch overrides TargetFrameLowering::getFrameIndexReference() in order to specify the correct register when the function needs dynamic stack realignment. The values returned from this function are used in order to create DW_AT_locations for DWARF info. These locations would use the wrong registers as it's been reported in PR25028. Reviewers: dsanders Subscribers: dean, llvm-commits Differential Revision: http://reviews.llvm.org/D13511 llvm-svn: 252882
Diffstat (limited to 'llvm/lib/Target/Mips/MipsSEFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsSEFrameLowering.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp b/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp
index 297e7a2ec8b..a4abd62ee60 100644
--- a/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp
@@ -753,6 +753,21 @@ void MipsSEFrameLowering::emitInterruptEpilogueStub(
.addImm(0);
}
+int MipsSEFrameLowering::getFrameIndexReference(const MachineFunction &MF,
+ int FI,
+ unsigned &FrameReg) const {
+ const MachineFrameInfo *MFI = MF.getFrameInfo();
+ MipsABIInfo ABI = STI.getABI();
+
+ if (MFI->isFixedObjectIndex(FI))
+ FrameReg = hasFP(MF) ? ABI.GetFramePtr() : ABI.GetStackPtr();
+ else
+ FrameReg = hasBP(MF) ? ABI.GetBasePtr() : ABI.GetStackPtr();
+
+ return MFI->getObjectOffset(FI) + MFI->getStackSize() -
+ getOffsetOfLocalArea() + MFI->getOffsetAdjustment();
+}
+
bool MipsSEFrameLowering::
spillCalleeSavedRegisters(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI,
OpenPOWER on IntegriCloud