Skip to content

Commit 8c86984

Browse files
authored
Merge pull request #80071 from gottesmm/pr-3d96950196ba1261544c5bf8ace8a5a4c439f54d
[gardening] Remove this-> from LangOpts that was added by mistake.
2 parents 0b2c160 + 13c9e9c commit 8c86984

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,9 @@ namespace swift {
816816
llvm::SmallVector<std::string, 2> CustomConditionalCompilationFlags;
817817

818818
public:
819+
//==========================================================================
819820
// MARK: Features
820-
// =========================================================================
821+
//==========================================================================
821822

822823
/// A wrapper around the feature state enumeration.
823824
struct FeatureState {

lib/Basic/LangOptions.cpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ using namespace swift;
3636
LangOptions::LangOptions() {
3737
// Add all promoted language features
3838
#define LANGUAGE_FEATURE(FeatureName, SENumber, Description) \
39-
this->enableFeature(Feature::FeatureName);
39+
enableFeature(Feature::FeatureName);
4040
#define UPCOMING_FEATURE(FeatureName, SENumber, Version)
4141
#define EXPERIMENTAL_FEATURE(FeatureName, AvailableInProd)
4242
#define OPTIONAL_LANGUAGE_FEATURE(FeatureName, SENumber, Description)
@@ -45,16 +45,16 @@ LangOptions::LangOptions() {
4545
// Special case: remove macro support if the compiler wasn't built with a
4646
// host Swift.
4747
#if !SWIFT_BUILD_SWIFT_SYNTAX
48-
this->disableFeature(Feature::Macros);
49-
this->disableFeature(Feature::FreestandingExpressionMacros);
50-
this->disableFeature(Feature::AttachedMacros);
51-
this->disableFeature(Feature::ExtensionMacros);
48+
disableFeature(Feature::Macros);
49+
disableFeature(Feature::FreestandingExpressionMacros);
50+
disableFeature(Feature::AttachedMacros);
51+
disableFeature(Feature::ExtensionMacros);
5252
#endif
5353

5454
// Note: Introduce default-on language options here.
55-
this->enableFeature(Feature::NoncopyableGenerics);
56-
this->enableFeature(Feature::BorrowingSwitch);
57-
this->enableFeature(Feature::MoveOnlyPartialConsumption);
55+
enableFeature(Feature::NoncopyableGenerics);
56+
enableFeature(Feature::BorrowingSwitch);
57+
enableFeature(Feature::MoveOnlyPartialConsumption);
5858

5959
// Enable any playground options that are enabled by default.
6060
#define PLAYGROUND_OPTION(OptionName, Description, DefaultOn, HighPerfOn) \
@@ -295,14 +295,14 @@ bool LangOptions::isCustomConditionalCompilationFlagSet(StringRef Name) const {
295295
}
296296

297297
bool LangOptions::FeatureState::isEnabled() const {
298-
return this->state == FeatureState::Kind::Enabled;
298+
return state == FeatureState::Kind::Enabled;
299299
}
300300

301301
bool LangOptions::FeatureState::isEnabledForAdoption() const {
302-
ASSERT(isFeatureAdoptable(this->feature) &&
302+
ASSERT(isFeatureAdoptable(feature) &&
303303
"You forgot to make the feature adoptable!");
304304

305-
return this->state == FeatureState::Kind::EnabledForAdoption;
305+
return state == FeatureState::Kind::EnabledForAdoption;
306306
}
307307

308308
LangOptions::FeatureStateStorage::FeatureStateStorage()
@@ -312,23 +312,23 @@ void LangOptions::FeatureStateStorage::setState(Feature feature,
312312
FeatureState::Kind state) {
313313
auto index = size_t(feature);
314314

315-
this->states[index] = state;
315+
states[index] = state;
316316
}
317317

318318
LangOptions::FeatureState
319319
LangOptions::FeatureStateStorage::getState(Feature feature) const {
320320
auto index = size_t(feature);
321321

322-
return FeatureState(feature, this->states[index]);
322+
return FeatureState(feature, states[index]);
323323
}
324324

325325
LangOptions::FeatureState LangOptions::getFeatureState(Feature feature) const {
326-
auto state = this->featureStates.getState(feature);
326+
auto state = featureStates.getState(feature);
327327
if (state.isEnabled())
328328
return state;
329329

330330
if (auto version = getFeatureLanguageVersion(feature)) {
331-
if (this->isSwiftVersionAtLeast(*version)) {
331+
if (isSwiftVersionAtLeast(*version)) {
332332
return FeatureState(feature, FeatureState::Kind::Enabled);
333333
}
334334
}
@@ -337,7 +337,7 @@ LangOptions::FeatureState LangOptions::getFeatureState(Feature feature) const {
337337
}
338338

339339
bool LangOptions::hasFeature(Feature feature) const {
340-
if (this->featureStates.getState(feature).isEnabled())
340+
if (featureStates.getState(feature).isEnabled())
341341
return true;
342342

343343
if (auto version = getFeatureLanguageVersion(feature))
@@ -361,15 +361,14 @@ bool LangOptions::hasFeature(llvm::StringRef featureName) const {
361361
void LangOptions::enableFeature(Feature feature, bool forAdoption) {
362362
if (forAdoption) {
363363
ASSERT(isFeatureAdoptable(feature));
364-
this->featureStates.setState(feature,
365-
FeatureState::Kind::EnabledForAdoption);
364+
featureStates.setState(feature, FeatureState::Kind::EnabledForAdoption);
366365
} else {
367-
this->featureStates.setState(feature, FeatureState::Kind::Enabled);
366+
featureStates.setState(feature, FeatureState::Kind::Enabled);
368367
}
369368
}
370369

371370
void LangOptions::disableFeature(Feature feature) {
372-
this->featureStates.setState(feature, FeatureState::Kind::Off);
371+
featureStates.setState(feature, FeatureState::Kind::Off);
373372
}
374373

375374
void LangOptions::setHasAtomicBitWidth(llvm::Triple triple) {

0 commit comments

Comments
 (0)