From a37aa546224ec03ba1f1a1598e0781af4b692673 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Sun, 22 Nov 2009 20:05:32 +0000 Subject: [PATCH] Move default FrameReg val to getFrameIndexReference(). Otherwise, debug info can get bogus values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89618 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMBaseRegisterInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp index cab82290f14..653328d8d02 100644 --- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp +++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp @@ -807,6 +807,7 @@ ARMBaseRegisterInfo::getFrameIndexReference(MachineFunction &MF, int FI, int Offset = MFI->getObjectOffset(FI) + MFI->getStackSize(); bool isFixed = MFI->isFixedObjectIndex(FI); + FrameReg = ARM::SP; if (AFI->isGPRCalleeSavedArea1Frame(FI)) Offset -= AFI->getGPRCalleeSavedArea1Offset(); else if (AFI->isGPRCalleeSavedArea2Frame(FI)) @@ -1162,9 +1163,9 @@ ARMBaseRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!"); } - unsigned FrameReg = ARM::SP; int FrameIndex = MI.getOperand(i).getIndex(); int Offset = MFI->getObjectOffset(FrameIndex) + MFI->getStackSize() + SPAdj; + unsigned FrameReg; Offset = getFrameIndexReference(MF, FrameIndex, FrameReg); if (FrameReg != ARM::SP)