Fix a bug in getFrameRegister.

Reported by Raul Herbster.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36262 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lauro Ramos Venancio 2007-04-19 14:09:38 +00:00
parent 843f0767ac
commit 267bfb553e

View File

@ -1474,7 +1474,10 @@ unsigned ARMRegisterInfo::getRARegister() const {
}
unsigned ARMRegisterInfo::getFrameRegister(MachineFunction &MF) const {
return STI.useThumbBacktraces() ? ARM::R7 : ARM::R11;
if (STI.isTargetDarwin() || hasFP(MF))
return STI.useThumbBacktraces() ? ARM::R7 : ARM::R11;
else
return ARM::SP;
}
unsigned ARMRegisterInfo::getEHExceptionRegister() const {