@@ -659,23 +659,40 @@ toolchains::Darwin::addDeploymentTargetArgs(ArgStringList &Arguments,
659
659
static unsigned getDWARFVersionForTriple (const llvm::Triple &triple) {
660
660
llvm::VersionTuple osVersion;
661
661
const DarwinPlatformKind kind = getDarwinPlatformKind (triple);
662
+ // Default to DWARF 2 on OS X 10.10 / iOS 8 and lower.
663
+ // Default to DWARF 4 on OS X 10.11 - macOS 14 / iOS - iOS 17.
662
664
switch (kind) {
663
665
case DarwinPlatformKind::MacOS:
664
666
triple.getMacOSXVersion (osVersion);
665
667
if (osVersion < llvm::VersionTuple (10 , 11 ))
666
668
return 2 ;
667
- return 4 ;
669
+ if (osVersion < llvm::VersionTuple (15 ))
670
+ return 4 ;
671
+ return 5 ;
668
672
case DarwinPlatformKind::IPhoneOSSimulator:
669
673
case DarwinPlatformKind::IPhoneOS:
670
674
case DarwinPlatformKind::TvOS:
671
675
case DarwinPlatformKind::TvOSSimulator:
672
676
osVersion = triple.getiOSVersion ();
673
- if (osVersion < llvm::VersionTuple (9 ))
674
- return 2 ;
675
- return 4 ;
676
- default :
677
- return 4 ;
677
+ if (osVersion < llvm::VersionTuple (9 ))
678
+ return 2 ;
679
+ if (osVersion < llvm::VersionTuple (18 ))
680
+ return 4 ;
681
+ return 5 ;
682
+ case DarwinPlatformKind::WatchOS:
683
+ case DarwinPlatformKind::WatchOSSimulator:
684
+ osVersion = triple.getWatchOSVersion ();
685
+ if (osVersion < llvm::VersionTuple (11 ))
686
+ return 4 ;
687
+ return 5 ;
688
+ case DarwinPlatformKind::VisionOS:
689
+ case DarwinPlatformKind::VisionOSSimulator:
690
+ osVersion = triple.getOSVersion ();
691
+ if (osVersion < llvm::VersionTuple (2 ))
692
+ return 4 ;
693
+ return 5 ;
678
694
}
695
+ llvm_unreachable (" unsupported platform kind" );
679
696
}
680
697
681
698
void toolchains::Darwin::addCommonFrontendArgs (
0 commit comments