@@ -457,33 +457,12 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
457457 }
458458 }
459459
460- switch (TT.getOS ()) {
461- case Triple::MacOSX:
462- if (TT.isMacOSXVersionLT (10 , 9 )) {
463- setLibcallName (RTLIB::EXP10_F32, nullptr );
464- setLibcallName (RTLIB::EXP10_F64, nullptr );
465- } else {
466- setLibcallName (RTLIB::EXP10_F32, " __exp10f" );
467- setLibcallName (RTLIB::EXP10_F64, " __exp10" );
468- }
469- break ;
470- case Triple::IOS:
471- if (TT.isOSVersionLT (7 , 0 )) {
472- setLibcallName (RTLIB::EXP10_F32, nullptr );
473- setLibcallName (RTLIB::EXP10_F64, nullptr );
474- break ;
475- }
476- [[fallthrough]];
477- case Triple::DriverKit:
478- case Triple::TvOS:
479- case Triple::WatchOS:
480- case Triple::XROS:
481- case Triple::BridgeOS:
460+ if (darwinHasExp10 (TT)) {
482461 setLibcallName (RTLIB::EXP10_F32, " __exp10f" );
483462 setLibcallName (RTLIB::EXP10_F64, " __exp10" );
484- break ;
485- default :
486- break ;
463+ } else {
464+ setLibcallName (RTLIB::EXP10_F32, nullptr );
465+ setLibcallName (RTLIB::EXP10_F64, nullptr ) ;
487466 }
488467 }
489468
@@ -662,3 +641,22 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
662641 if (TT.getArch () == Triple::ArchType::msp430)
663642 setMSP430Libcalls (*this , TT);
664643}
644+
645+ bool RuntimeLibcallsInfo::darwinHasExp10 (const Triple &TT) {
646+ assert (TT.isOSDarwin () && " should be called with darwin triple" );
647+
648+ switch (TT.getOS ()) {
649+ case Triple::MacOSX:
650+ return !TT.isMacOSXVersionLT (10 , 9 );
651+ case Triple::IOS:
652+ return !TT.isOSVersionLT (7 , 0 );
653+ case Triple::DriverKit:
654+ case Triple::TvOS:
655+ case Triple::WatchOS:
656+ case Triple::XROS:
657+ case Triple::BridgeOS:
658+ return true ;
659+ default :
660+ return false ;
661+ }
662+ }
0 commit comments