aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/ARMFrameLowering.cpp
diff options
context:
space:
mode:
authorOleg Ranevskyy <oranevskyy@accesssoftek.com>2015-11-05 17:50:17 +0000
committerOleg Ranevskyy <oranevskyy@accesssoftek.com>2015-11-05 17:50:17 +0000
commit057c5a6b2b082b62c8f33a8d6d6e942b8165757a (patch)
tree35fe0e16293ab2eca1c690571369fea7db07aa83 /llvm/lib/Target/ARM/ARMFrameLowering.cpp
parent99fba3c1416447737bdc76c751ed8775d4abb106 (diff)
downloadllvm-057c5a6b2b082b62c8f33a8d6d6e942b8165757a.zip
llvm-057c5a6b2b082b62c8f33a8d6d6e942b8165757a.tar.gz
llvm-057c5a6b2b082b62c8f33a8d6d6e942b8165757a.tar.bz2
[DebugInfo] Fix ARM/AArch64 prologue_end position. Related to D11268.
Summary: This review is related to another review request http://reviews.llvm.org/D11268, does the same and merely fixes a couple of issues with it. D11268 is quite old and has merge conflicts against the current trunk. This request - rebases D11268 onto the new trunk; - resolves the merge conflicts; - fixes the prologue_end tests, which do not pass due to the subprogram definitions not marked as distinct. Reviewers: echristo, rengolin, kubabrecka Subscribers: aemerson, rengolin, jyknight, dsanders, llvm-commits, asl Differential Revision: http://reviews.llvm.org/D14338 llvm-svn: 252177
Diffstat (limited to 'llvm/lib/Target/ARM/ARMFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMFrameLowering.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 966f031..9865520 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -302,13 +302,17 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
"This emitPrologue does not support Thumb1!");
bool isARM = !AFI->isThumbFunction();
unsigned Align = STI.getFrameLowering()->getStackAlignment();
- unsigned ArgRegsSaveSize = AFI->getArgRegsSaveSize();
- unsigned NumBytes = MFI->getStackSize();
- const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
- DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
- unsigned FramePtr = RegInfo->getFrameRegister(MF);
-
- // Determine the sizes of each callee-save spill areas and record which frame
+ unsigned ArgRegsSaveSize = AFI->getArgRegsSaveSize();
+ unsigned NumBytes = MFI->getStackSize();
+ const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
+
+ // Debug location must be unknown since the first debug location is used
+ // to determine the end of the prologue.
+ DebugLoc dl;
+
+ unsigned FramePtr = RegInfo->getFrameRegister(MF);
+
+ // Determine the sizes of each callee-save spill areas and record which frame
// belongs to which callee-save spill areas.
unsigned GPRCS1Size = 0, GPRCS2Size = 0, DPRCSSize = 0;
int FramePtrSpillFI = 0;
@@ -890,13 +894,12 @@ void ARMFrameLowering::emitPushInst(MachineBasicBlock &MBB,
unsigned NumAlignedDPRCS2Regs,
unsigned MIFlags) const {
MachineFunction &MF = *MBB.getParent();
- const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
-
- DebugLoc DL;
- if (MI != MBB.end()) DL = MI->getDebugLoc();
-
- SmallVector<std::pair<unsigned,bool>, 4> Regs;
- unsigned i = CSI.size();
+ const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
+
+ DebugLoc DL;
+
+ SmallVector<std::pair<unsigned,bool>, 4> Regs;
+ unsigned i = CSI.size();
while (i != 0) {
unsigned LastReg = 0;
for (; i != 0; --i) {