-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[lldb] Correct bridgeOS -> BridgeOS spelling #163479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-lldb Author: Jonas Devlieghere (JDevlieghere) ChangesIgnore case when parsing the Xcode SDK. The BridgeOS SDK is capitalized, but previously failed to parse because we were looking for bridgeOS. This PR updates the enum value and the canonical spelling, and also relaxes the parsing to be case insensitive. rdar://162641896 Full diff: https://github.com/llvm/llvm-project/pull/163479.diff 4 Files Affected:
diff --git a/lldb/include/lldb/Utility/XcodeSDK.h b/lldb/include/lldb/Utility/XcodeSDK.h
index 5b345a4965cf9..5f89019537689 100644
--- a/lldb/include/lldb/Utility/XcodeSDK.h
+++ b/lldb/include/lldb/Utility/XcodeSDK.h
@@ -38,7 +38,7 @@ class XcodeSDK {
watchOS,
XRSimulator,
XROS,
- bridgeOS,
+ BridgeOS,
Linux,
unknown = -1
};
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index cd72454fe0287..5aad4470091bc 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -1150,7 +1150,7 @@ void PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
case XcodeSDK::Type::XRSimulator:
case XcodeSDK::Type::XROS:
// FIXME: Pass the right argument once it exists.
- case XcodeSDK::Type::bridgeOS:
+ case XcodeSDK::Type::BridgeOS:
case XcodeSDK::Type::Linux:
case XcodeSDK::Type::unknown:
if (Log *log = GetLog(LLDBLog::Host)) {
diff --git a/lldb/source/Utility/XcodeSDK.cpp b/lldb/source/Utility/XcodeSDK.cpp
index 2040791882fd0..d20d485e64328 100644
--- a/lldb/source/Utility/XcodeSDK.cpp
+++ b/lldb/source/Utility/XcodeSDK.cpp
@@ -38,8 +38,8 @@ static llvm::StringRef GetName(XcodeSDK::Type type) {
return "XRSimulator";
case XcodeSDK::XROS:
return "XROS";
- case XcodeSDK::bridgeOS:
- return "bridgeOS";
+ case XcodeSDK::BridgeOS:
+ return "BridgeOS";
case XcodeSDK::Linux:
return "Linux";
case XcodeSDK::unknown:
@@ -65,27 +65,27 @@ bool XcodeSDK::operator==(const XcodeSDK &other) const {
}
static XcodeSDK::Type ParseSDKName(llvm::StringRef &name) {
- if (name.consume_front("MacOSX"))
+ if (name.consume_front_insensitive("MacOSX"))
return XcodeSDK::MacOSX;
- if (name.consume_front("iPhoneSimulator"))
+ if (name.consume_front_insensitive("iPhoneSimulator"))
return XcodeSDK::iPhoneSimulator;
- if (name.consume_front("iPhoneOS"))
+ if (name.consume_front_insensitive("iPhoneOS"))
return XcodeSDK::iPhoneOS;
- if (name.consume_front("AppleTVSimulator"))
+ if (name.consume_front_insensitive("AppleTVSimulator"))
return XcodeSDK::AppleTVSimulator;
- if (name.consume_front("AppleTVOS"))
+ if (name.consume_front_insensitive("AppleTVOS"))
return XcodeSDK::AppleTVOS;
- if (name.consume_front("WatchSimulator"))
+ if (name.consume_front_insensitive("WatchSimulator"))
return XcodeSDK::WatchSimulator;
- if (name.consume_front("WatchOS"))
+ if (name.consume_front_insensitive("WatchOS"))
return XcodeSDK::watchOS;
- if (name.consume_front("XRSimulator"))
+ if (name.consume_front_insensitive("XRSimulator"))
return XcodeSDK::XRSimulator;
- if (name.consume_front("XROS"))
+ if (name.consume_front_insensitive("XROS"))
return XcodeSDK::XROS;
- if (name.consume_front("bridgeOS"))
- return XcodeSDK::bridgeOS;
- if (name.consume_front("Linux"))
+ if (name.consume_front_insensitive("BridgeOS"))
+ return XcodeSDK::BridgeOS;
+ if (name.consume_front_insensitive("Linux"))
return XcodeSDK::Linux;
static_assert(XcodeSDK::Linux == XcodeSDK::numSDKTypes - 1,
"New SDK type was added, update this list!");
@@ -110,7 +110,8 @@ static llvm::VersionTuple ParseSDKVersion(llvm::StringRef &name) {
}
static bool ParseAppleInternalSDK(llvm::StringRef &name) {
- return name.consume_front("Internal.") || name.consume_front(".Internal.");
+ return name.consume_front_insensitive("Internal.") ||
+ name.consume_front_insensitive(".Internal.");
}
XcodeSDK::Info XcodeSDK::Parse() const {
@@ -204,7 +205,7 @@ std::string XcodeSDK::GetCanonicalName(XcodeSDK::Info info) {
case XROS:
name = "xros";
break;
- case bridgeOS:
+ case BridgeOS:
name = "bridgeos";
break;
case Linux:
diff --git a/lldb/unittests/Utility/XcodeSDKTest.cpp b/lldb/unittests/Utility/XcodeSDKTest.cpp
index de9f91a04d53e..f3964f25c821b 100644
--- a/lldb/unittests/Utility/XcodeSDKTest.cpp
+++ b/lldb/unittests/Utility/XcodeSDKTest.cpp
@@ -27,6 +27,8 @@ TEST(XcodeSDKTest, ParseTest) {
EXPECT_EQ(XcodeSDK("AppleTVOS.sdk").GetType(), XcodeSDK::AppleTVOS);
EXPECT_EQ(XcodeSDK("WatchSimulator.sdk").GetType(), XcodeSDK::WatchSimulator);
EXPECT_EQ(XcodeSDK("WatchOS.sdk").GetType(), XcodeSDK::watchOS);
+ EXPECT_EQ(XcodeSDK("BridgeOS.sdk").GetType(), XcodeSDK::BridgeOS);
+ EXPECT_EQ(XcodeSDK("bridgeOS.sdk").GetType(), XcodeSDK::BridgeOS);
EXPECT_EQ(XcodeSDK("XRSimulator.sdk").GetType(), XcodeSDK::XRSimulator);
EXPECT_EQ(XcodeSDK("XROS.sdk").GetType(), XcodeSDK::XROS);
EXPECT_EQ(XcodeSDK("Linux.sdk").GetType(), XcodeSDK::Linux);
|
The BridgeOS SDK is capitalized, but previously failed to parse because we were looking for bridgeOS. This PR updates the enum value and the canonical spelling. rdar://162641896
3b94837 to
3c71552
Compare
The BridgeOS SDK is capitalized, but previously failed to parse because we were looking for bridgeOS. This PR updates the enum value and the canonical spelling. rdar://162641896 (cherry picked from commit 3e251e7)
[lldb] Correct bridgeOS -> BridgeOS spelling (llvm#163479)
The BridgeOS SDK is capitalized, but previously failed to parse because
we were looking for bridgeOS. This PR updates the enum value and the
canonical spelling.
rdar://162641896