summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-09-25 16:34:46 +0000
committerBob Wilson <bob.wilson@apple.com>2009-09-25 16:34:46 +0000
commitc8ce2d4cb9ef5ff8b3c574e522c870741d88ba58 (patch)
tree322db420ca6c31c5be67d6eda66abaeffebb1c52
parent42985bbe385264550cd01acfdb412abf0de316d3 (diff)
downloadllvm-c8ce2d4cb9ef5ff8b3c574e522c870741d88ba58.tar.gz
llvm-c8ce2d4cb9ef5ff8b3c574e522c870741d88ba58.tar.bz2
llvm-c8ce2d4cb9ef5ff8b3c574e522c870741d88ba58.tar.xz
Add some comments to clarify things that I discovered this week.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82773 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMBaseRegisterInfo.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index 648f97fb1b..ab3dcd6992 100644
--- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -1151,6 +1151,7 @@ emitPrologue(MachineFunction &MF) const {
unsigned GPRCS1Size = 0, GPRCS2Size = 0, DPRCSSize = 0;
int FramePtrSpillFI = 0;
+ // Allocate the vararg register save area. This is not counted in NumBytes.
if (VARegSaveSize)
emitSPUpdate(isARM, MBB, MBBI, dl, TII, -VARegSaveSize);
@@ -1198,8 +1199,11 @@ emitPrologue(MachineFunction &MF) const {
emitSPUpdate(isARM, MBB, MBBI, dl, TII, -GPRCS1Size);
movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, ARM::t2STRi12, 1, STI);
- // Darwin ABI requires FP to point to the stack slot that contains the
- // previous FP.
+ // Set FP to point to the stack slot that contains the previous FP.
+ // For Darwin, FP is R7, which has now been stored in spill area 1.
+ // Otherwise, if this is not Darwin, all the callee-saved registers go
+ // into spill area 1, including the FP in R11. In either case, it is
+ // now safe to emit this assignment.
if (STI.isTargetDarwin() || hasFP(MF)) {
unsigned ADDriOpc = !AFI->isThumbFunction() ? ARM::ADDri : ARM::t2ADDri;
MachineInstrBuilder MIB =