@@ -956,23 +956,14 @@ const std::string &SwiftASTContext::GetDescription() const {
956
956
return m_description;
957
957
}
958
958
959
- namespace {
960
- struct SDKTypeMinVersion {
961
- XcodeSDK::Type sdk_type;
962
- unsigned min_version_major;
963
- unsigned min_version_minor;
964
- };
965
- } // namespace
966
-
967
- // / Return the SDKType (+minimum version needed for Swift support) for
968
- // / the target triple, if that makes sense. Otherwise, return the
969
- // / unknown sdk type.
970
- static SDKTypeMinVersion GetSDKType (const llvm::Triple &target,
971
- const llvm::Triple &host) {
959
+ // / Return the Xcode sdk type for the target triple, if that makes sense.
960
+ // / Otherwise, return the unknown sdk type.
961
+ static XcodeSDK::Type GetSDKType (const llvm::Triple &target,
962
+ const llvm::Triple &host) {
972
963
// Only Darwin platforms know the concept of an SDK.
973
964
auto host_os = host.getOS ();
974
965
if (host_os != llvm::Triple::OSType::MacOSX)
975
- return { XcodeSDK::Type::unknown, 0 , 0 } ;
966
+ return XcodeSDK::Type::unknown;
976
967
977
968
auto is_simulator = [&]() -> bool {
978
969
return target.getEnvironment () == llvm::Triple::Simulator ||
@@ -982,31 +973,30 @@ static SDKTypeMinVersion GetSDKType(const llvm::Triple &target,
982
973
switch (target.getOS ()) {
983
974
case llvm::Triple::OSType::MacOSX:
984
975
case llvm::Triple::OSType::Darwin:
985
- return { XcodeSDK::Type::MacOSX, 10 , 10 } ;
976
+ return XcodeSDK::Type::MacOSX;
986
977
case llvm::Triple::OSType::IOS:
987
978
if (is_simulator ())
988
- return { XcodeSDK::Type::iPhoneSimulator, 8 , 0 } ;
989
- return { XcodeSDK::Type::iPhoneOS, 8 , 0 } ;
979
+ return XcodeSDK::Type::iPhoneSimulator;
980
+ return XcodeSDK::Type::iPhoneOS;
990
981
case llvm::Triple::OSType::TvOS:
991
982
if (is_simulator ())
992
- return { XcodeSDK::Type::AppleTVSimulator, 9 , 0 } ;
993
- return { XcodeSDK::Type::AppleTVOS, 9 , 0 } ;
983
+ return XcodeSDK::Type::AppleTVSimulator;
984
+ return XcodeSDK::Type::AppleTVOS;
994
985
case llvm::Triple::OSType::WatchOS:
995
986
if (is_simulator ())
996
- return { XcodeSDK::Type::WatchSimulator, 2 , 0 } ;
997
- return { XcodeSDK::Type::watchOS, 2 , 0 } ;
987
+ return XcodeSDK::Type::WatchSimulator;
988
+ return XcodeSDK::Type::watchOS;
998
989
default :
999
- return { XcodeSDK::Type::unknown, 0 , 0 } ;
990
+ return XcodeSDK::Type::unknown;
1000
991
}
1001
992
}
1002
993
1003
994
// / Return the name of the OS-specific subdirectory containing the
1004
995
// / Swift stdlib needed for \p target.
1005
996
std::string SwiftASTContext::GetSwiftStdlibOSDir (const llvm::Triple &target,
1006
997
const llvm::Triple &host) {
1007
- auto sdk = GetSDKType (target, host);
1008
998
XcodeSDK::Info sdk_info;
1009
- sdk_info.type = sdk. sdk_type ;
999
+ sdk_info.type = GetSDKType (target, host) ;
1010
1000
std::string sdk_name = XcodeSDK::GetCanonicalName (sdk_info);
1011
1001
if (!sdk_name.empty ())
1012
1002
return sdk_name;
0 commit comments