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