From 13c9e9c9942cc1e228e2eb6b51b5c947f7f73590 Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Thu, 13 Mar 2025 12:54:47 -0700 Subject: [PATCH] [gardening] Remove this-> from LangOpts that was added by mistake. --- include/swift/Basic/LangOptions.h | 3 ++- lib/Basic/LangOptions.cpp | 39 +++++++++++++++---------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index c0e3e674b25..54f65fc462e 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -816,8 +816,9 @@ namespace swift { llvm::SmallVector CustomConditionalCompilationFlags; public: + //========================================================================== // MARK: Features - // ========================================================================= + //========================================================================== /// A wrapper around the feature state enumeration. struct FeatureState { diff --git a/lib/Basic/LangOptions.cpp b/lib/Basic/LangOptions.cpp index 427a8659384..a65755018c1 100644 --- a/lib/Basic/LangOptions.cpp +++ b/lib/Basic/LangOptions.cpp @@ -36,7 +36,7 @@ using namespace swift; LangOptions::LangOptions() { // Add all promoted language features #define LANGUAGE_FEATURE(FeatureName, SENumber, Description) \ - this->enableFeature(Feature::FeatureName); + enableFeature(Feature::FeatureName); #define UPCOMING_FEATURE(FeatureName, SENumber, Version) #define EXPERIMENTAL_FEATURE(FeatureName, AvailableInProd) #define OPTIONAL_LANGUAGE_FEATURE(FeatureName, SENumber, Description) @@ -45,16 +45,16 @@ LangOptions::LangOptions() { // Special case: remove macro support if the compiler wasn't built with a // host Swift. #if !SWIFT_BUILD_SWIFT_SYNTAX - this->disableFeature(Feature::Macros); - this->disableFeature(Feature::FreestandingExpressionMacros); - this->disableFeature(Feature::AttachedMacros); - this->disableFeature(Feature::ExtensionMacros); + disableFeature(Feature::Macros); + disableFeature(Feature::FreestandingExpressionMacros); + disableFeature(Feature::AttachedMacros); + disableFeature(Feature::ExtensionMacros); #endif // Note: Introduce default-on language options here. - this->enableFeature(Feature::NoncopyableGenerics); - this->enableFeature(Feature::BorrowingSwitch); - this->enableFeature(Feature::MoveOnlyPartialConsumption); + enableFeature(Feature::NoncopyableGenerics); + enableFeature(Feature::BorrowingSwitch); + enableFeature(Feature::MoveOnlyPartialConsumption); // Enable any playground options that are enabled by default. #define PLAYGROUND_OPTION(OptionName, Description, DefaultOn, HighPerfOn) \ @@ -295,14 +295,14 @@ bool LangOptions::isCustomConditionalCompilationFlagSet(StringRef Name) const { } bool LangOptions::FeatureState::isEnabled() const { - return this->state == FeatureState::Kind::Enabled; + return state == FeatureState::Kind::Enabled; } bool LangOptions::FeatureState::isEnabledForAdoption() const { - ASSERT(isFeatureAdoptable(this->feature) && + ASSERT(isFeatureAdoptable(feature) && "You forgot to make the feature adoptable!"); - return this->state == FeatureState::Kind::EnabledForAdoption; + return state == FeatureState::Kind::EnabledForAdoption; } LangOptions::FeatureStateStorage::FeatureStateStorage() @@ -312,23 +312,23 @@ void LangOptions::FeatureStateStorage::setState(Feature feature, FeatureState::Kind state) { auto index = size_t(feature); - this->states[index] = state; + states[index] = state; } LangOptions::FeatureState LangOptions::FeatureStateStorage::getState(Feature feature) const { auto index = size_t(feature); - return FeatureState(feature, this->states[index]); + return FeatureState(feature, states[index]); } LangOptions::FeatureState LangOptions::getFeatureState(Feature feature) const { - auto state = this->featureStates.getState(feature); + auto state = featureStates.getState(feature); if (state.isEnabled()) return state; if (auto version = getFeatureLanguageVersion(feature)) { - if (this->isSwiftVersionAtLeast(*version)) { + if (isSwiftVersionAtLeast(*version)) { return FeatureState(feature, FeatureState::Kind::Enabled); } } @@ -337,7 +337,7 @@ LangOptions::FeatureState LangOptions::getFeatureState(Feature feature) const { } bool LangOptions::hasFeature(Feature feature) const { - if (this->featureStates.getState(feature).isEnabled()) + if (featureStates.getState(feature).isEnabled()) return true; if (auto version = getFeatureLanguageVersion(feature)) @@ -361,15 +361,14 @@ bool LangOptions::hasFeature(llvm::StringRef featureName) const { void LangOptions::enableFeature(Feature feature, bool forAdoption) { if (forAdoption) { ASSERT(isFeatureAdoptable(feature)); - this->featureStates.setState(feature, - FeatureState::Kind::EnabledForAdoption); + featureStates.setState(feature, FeatureState::Kind::EnabledForAdoption); } else { - this->featureStates.setState(feature, FeatureState::Kind::Enabled); + featureStates.setState(feature, FeatureState::Kind::Enabled); } } void LangOptions::disableFeature(Feature feature) { - this->featureStates.setState(feature, FeatureState::Kind::Off); + featureStates.setState(feature, FeatureState::Kind::Off); } void LangOptions::setHasAtomicBitWidth(llvm::Triple triple) {