Fix a bug in getFrameRegister.

Reported by Raul Herbster.

llvm-svn: 36262
This commit is contained in:
Lauro Ramos Venancio 2007-04-19 14:09:38 +00:00
parent aafe4e216e
commit 42cd7253b1
1 changed files with 4 additions and 1 deletions

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 {