Skip to content

Commit 8b4225d

Browse files
committed
[lldb] Remove superfluous SDKTypeMinVersion type (NFC)
1 parent b068ac5 commit 8b4225d

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -956,23 +956,14 @@ const std::string &SwiftASTContext::GetDescription() const {
956956
return m_description;
957957
}
958958

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) {
972963
// Only Darwin platforms know the concept of an SDK.
973964
auto host_os = host.getOS();
974965
if (host_os != llvm::Triple::OSType::MacOSX)
975-
return {XcodeSDK::Type::unknown, 0, 0};
966+
return XcodeSDK::Type::unknown;
976967

977968
auto is_simulator = [&]() -> bool {
978969
return target.getEnvironment() == llvm::Triple::Simulator ||
@@ -982,31 +973,30 @@ static SDKTypeMinVersion GetSDKType(const llvm::Triple &target,
982973
switch (target.getOS()) {
983974
case llvm::Triple::OSType::MacOSX:
984975
case llvm::Triple::OSType::Darwin:
985-
return {XcodeSDK::Type::MacOSX, 10, 10};
976+
return XcodeSDK::Type::MacOSX;
986977
case llvm::Triple::OSType::IOS:
987978
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;
990981
case llvm::Triple::OSType::TvOS:
991982
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;
994985
case llvm::Triple::OSType::WatchOS:
995986
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;
998989
default:
999-
return {XcodeSDK::Type::unknown, 0, 0};
990+
return XcodeSDK::Type::unknown;
1000991
}
1001992
}
1002993

1003994
/// Return the name of the OS-specific subdirectory containing the
1004995
/// Swift stdlib needed for \p target.
1005996
std::string SwiftASTContext::GetSwiftStdlibOSDir(const llvm::Triple &target,
1006997
const llvm::Triple &host) {
1007-
auto sdk = GetSDKType(target, host);
1008998
XcodeSDK::Info sdk_info;
1009-
sdk_info.type = sdk.sdk_type;
999+
sdk_info.type = GetSDKType(target, host);
10101000
std::string sdk_name = XcodeSDK::GetCanonicalName(sdk_info);
10111001
if (!sdk_name.empty())
10121002
return sdk_name;

0 commit comments

Comments
 (0)