Index: lib/Target/ARM/ARMBaseRegisterInfo.cpp =================================================================== --- lib/Target/ARM/ARMBaseRegisterInfo.cpp +++ lib/Target/ARM/ARMBaseRegisterInfo.cpp @@ -92,7 +92,7 @@ } } - if (STI.isTargetDarwin() && STI.getTargetLowering()->supportSwiftError() && + if (STI.getTargetLowering()->supportSwiftError() && F->getAttributes().hasAttrSomewhere(Attribute::SwiftError)) return CSR_iOS_SwiftError_SaveList; @@ -120,7 +120,7 @@ // This is academic because all GHC calls are (supposed to be) tail calls return CSR_NoRegs_RegMask; - if (STI.isTargetDarwin() && STI.getTargetLowering()->supportSwiftError() && + if (STI.getTargetLowering()->supportSwiftError() && MF.getFunction()->getAttributes().hasAttrSomewhere(Attribute::SwiftError)) return CSR_iOS_SwiftError_RegMask;