@@ -65,7 +65,17 @@ static void setAArch64LibcallNames(RuntimeLibcallsInfo &Info,
6565#undef LCALLNAME5
6666}
6767
68- static void setARMLibcallNames (RuntimeLibcallsInfo &Info, const Triple &TT) {
68+ static void setARMLibcallNames (RuntimeLibcallsInfo &Info, const Triple &TT,
69+ FloatABI::ABIType FloatABIType,
70+ EABI EABIVersion) {
71+ if (!TT.isOSDarwin () && !TT.isiOS () && !TT.isWatchOS () && !TT.isDriverKit ()) {
72+ CallingConv::ID DefaultCC = FloatABIType == FloatABI::Hard
73+ ? CallingConv::ARM_AAPCS_VFP
74+ : CallingConv::ARM_AAPCS;
75+ for (RTLIB::Libcall LC : RTLIB::libcalls ())
76+ Info.setLibcallCallingConv (LC, DefaultCC);
77+ }
78+
6979 // Register based DivRem for AEABI (RTABI 4.2)
7080 if (TT.isTargetAEABI () || TT.isAndroid () || TT.isTargetGNUAEABI () ||
7181 TT.isTargetMuslAEABI () || TT.isOSWindows ()) {
@@ -346,7 +356,9 @@ static void setLongDoubleIsF128Libm(RuntimeLibcallsInfo &Info,
346356
347357// / Set default libcall names. If a target wants to opt-out of a libcall it
348358// / should be placed here.
349- void RuntimeLibcallsInfo::initLibcalls (const Triple &TT) {
359+ void RuntimeLibcallsInfo::initLibcalls (const Triple &TT,
360+ FloatABI::ABIType FloatABI,
361+ EABI EABIVersion) {
350362 initSoftFloatCmpLibcallPredicates ();
351363
352364 initSoftFloatCmpLibcallPredicates ();
@@ -539,7 +551,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
539551 if (TT.isAArch64 ())
540552 setAArch64LibcallNames (*this , TT);
541553 else if (TT.isARM () || TT.isThumb ())
542- setARMLibcallNames (*this , TT);
554+ setARMLibcallNames (*this , TT, FloatABI, EABIVersion );
543555 else if (TT.getArch () == Triple::ArchType::avr) {
544556 // Division rtlib functions (not supported), use divmod functions instead
545557 setLibcallName (RTLIB::SDIV_I8, nullptr );
0 commit comments