| Index: lib/Target/ARM/ARMISelLowering.cpp
|
| diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
|
| index c516b42344df09c646939d1f12af2eafba038218..3e402d7a1c8e786381654e480b3d3385956c9eb5 100644
|
| --- a/lib/Target/ARM/ARMISelLowering.cpp
|
| +++ b/lib/Target/ARM/ARMISelLowering.cpp
|
| @@ -765,16 +765,23 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM,
|
| if (!Subtarget->isTargetMachO()) {
|
| // Non-MachO platforms may return values in these registers via the
|
| // personality function.
|
| - setExceptionPointerRegister(ARM::R0);
|
| - setExceptionSelectorRegister(ARM::R1);
|
| - }
|
| + // @LOCALMOD-START
|
| + if (Subtarget->isTargetNaCl()) {
|
| + // we use the first caller saved regs here
|
| + // c.f.: llvm-gcc/llvm-gcc-4.2/gcc/unwind-dw2.c::uw_install_context
|
| + // NOTE: these are related to the _Unwind_PNaClSetResult{0,1} functions
|
| + setExceptionPointerRegister(ARM::R4);
|
| + setExceptionSelectorRegister(ARM::R5);
|
| +
|
| + setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i32, Custom);
|
|
|
| - // @LOCALMOD-START
|
| - if (Subtarget->isTargetNaCl()) {
|
| - setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i32, Custom);
|
| - setOperationAction(ISD::EH_RETURN, MVT::Other, Custom);
|
| + setOperationAction(ISD::EH_RETURN, MVT::Other, Custom);
|
| + } else {
|
| + setExceptionPointerRegister(ARM::R0);
|
| + setExceptionSelectorRegister(ARM::R1);
|
| + }
|
| + // @LOCALMOD-END
|
| }
|
| - // @LOCALMOD-END
|
|
|
| if (Subtarget->getTargetTriple().isWindowsItaniumEnvironment())
|
| setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Custom);
|
|
|