summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2009-11-22 20:14:00 +0000
committerJim Grosbach <grosbach@apple.com>2009-11-22 20:14:00 +0000
commita2f20b20a8dc7f053599840557405554a0848aec (patch)
treebfc706ed738609b2a1e005312cd04306d543cc39 /include
parenta37aa546224ec03ba1f1a1598e0781af4b692673 (diff)
downloadllvm-a2f20b20a8dc7f053599840557405554a0848aec.tar.gz
llvm-a2f20b20a8dc7f053599840557405554a0848aec.tar.bz2
llvm-a2f20b20a8dc7f053599840557405554a0848aec.tar.xz
Add getFrameIndexReference() to TargetRegisterInfo, which allows targets to
tell debug info which base register to use to reference a frame index on a per-index basis. This is useful, for example, in the presence of dynamic stack realignment when local variables are indexed via the stack pointer and stack-based arguments via the frame pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetRegisterInfo.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetRegisterInfo.h b/include/llvm/Target/TargetRegisterInfo.h
index 07737590af..cb29c7306e 100644
--- a/include/llvm/Target/TargetRegisterInfo.h
+++ b/include/llvm/Target/TargetRegisterInfo.h
@@ -698,6 +698,18 @@ public:
/// the stack frame of the specified index.
virtual int getFrameIndexOffset(MachineFunction &MF, int FI) const;
+ /// getFrameIndexReference - This method should return the base register
+ /// and offset used to reference a frame index location. The offset is
+ /// returned directly, and the base register is returned via FrameReg.
+ virtual int getFrameIndexReference(MachineFunction &MF, int FI,
+ unsigned &FrameReg) const {
+ // By default, assume all frame indices are referenced via whatever
+ // getFrameRegister() says. The target can override this if it's doing
+ // something different.
+ FrameReg = getFrameRegister(MF);
+ return getFrameIndexOffset(MF, FI);
+ }
+
/// getRARegister - This method should return the register where the return
/// address can be found.
virtual unsigned getRARegister() const = 0;