diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-05-18 04:12:52 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-05-18 04:12:52 +0000 |
commit | bf3e78f5728f116067f8a373a522c221ccdaa08f (patch) | |
tree | 01c99ddf277668f30adadf98056a7d821961ac22 /lib/Target/ARM | |
parent | 4da07c20388a2f3ec8dcf8f2910cde86cb228cbf (diff) | |
download | llvm-bf3e78f5728f116067f8a373a522c221ccdaa08f.tar.gz llvm-bf3e78f5728f116067f8a373a522c221ccdaa08f.tar.bz2 llvm-bf3e78f5728f116067f8a373a522c221ccdaa08f.tar.xz |
ARM: improve WoA ABI conformance for frame register
Windows on ARM uses R11 for the frame pointer even though the environment is a
pure Thumb-2, thumb-only environment. Replicate this behaviour to improve
Windows ABI compatibility. This register is used for fast stack walking, and
thus is part of the Windows ABI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/ARMBaseRegisterInfo.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp index 9548dd50b2..a2eee9ff30 100644 --- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp +++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp @@ -44,9 +44,13 @@ using namespace llvm; ARMBaseRegisterInfo::ARMBaseRegisterInfo(const ARMSubtarget &sti) - : ARMGenRegisterInfo(ARM::LR, 0, 0, ARM::PC), STI(sti), - FramePtr((STI.isTargetMachO() || STI.isThumb()) ? ARM::R7 : ARM::R11), - BasePtr(ARM::R6) { + : ARMGenRegisterInfo(ARM::LR, 0, 0, ARM::PC), STI(sti), BasePtr(ARM::R6) { + if (STI.isTargetMachO()) + FramePtr = ARM::R7; + else if (STI.isTargetWindows()) + FramePtr = ARM::R11; + else // ARM EABI + FramePtr = STI.isThumb() ? ARM::R7 : ARM::R11; } const MCPhysReg* |