@@ -36,7 +36,7 @@ using namespace swift;
36
36
LangOptions::LangOptions () {
37
37
// Add all promoted language features
38
38
#define LANGUAGE_FEATURE (FeatureName, SENumber, Description ) \
39
- this -> enableFeature (Feature::FeatureName);
39
+ enableFeature (Feature::FeatureName);
40
40
#define UPCOMING_FEATURE (FeatureName, SENumber, Version )
41
41
#define EXPERIMENTAL_FEATURE (FeatureName, AvailableInProd )
42
42
#define OPTIONAL_LANGUAGE_FEATURE (FeatureName, SENumber, Description )
@@ -45,16 +45,16 @@ LangOptions::LangOptions() {
45
45
// Special case: remove macro support if the compiler wasn't built with a
46
46
// host Swift.
47
47
#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);
52
52
#endif
53
53
54
54
// 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);
58
58
59
59
// Enable any playground options that are enabled by default.
60
60
#define PLAYGROUND_OPTION (OptionName, Description, DefaultOn, HighPerfOn ) \
@@ -295,14 +295,14 @@ bool LangOptions::isCustomConditionalCompilationFlagSet(StringRef Name) const {
295
295
}
296
296
297
297
bool LangOptions::FeatureState::isEnabled () const {
298
- return this -> state == FeatureState::Kind::Enabled;
298
+ return state == FeatureState::Kind::Enabled;
299
299
}
300
300
301
301
bool LangOptions::FeatureState::isEnabledForAdoption () const {
302
- ASSERT (isFeatureAdoptable (this -> feature ) &&
302
+ ASSERT (isFeatureAdoptable (feature) &&
303
303
" You forgot to make the feature adoptable!" );
304
304
305
- return this -> state == FeatureState::Kind::EnabledForAdoption;
305
+ return state == FeatureState::Kind::EnabledForAdoption;
306
306
}
307
307
308
308
LangOptions::FeatureStateStorage::FeatureStateStorage ()
@@ -312,23 +312,23 @@ void LangOptions::FeatureStateStorage::setState(Feature feature,
312
312
FeatureState::Kind state) {
313
313
auto index = size_t (feature);
314
314
315
- this -> states [index] = state;
315
+ states[index] = state;
316
316
}
317
317
318
318
LangOptions::FeatureState
319
319
LangOptions::FeatureStateStorage::getState (Feature feature) const {
320
320
auto index = size_t (feature);
321
321
322
- return FeatureState (feature, this -> states [index]);
322
+ return FeatureState (feature, states[index]);
323
323
}
324
324
325
325
LangOptions::FeatureState LangOptions::getFeatureState (Feature feature) const {
326
- auto state = this -> featureStates .getState (feature);
326
+ auto state = featureStates.getState (feature);
327
327
if (state.isEnabled ())
328
328
return state;
329
329
330
330
if (auto version = getFeatureLanguageVersion (feature)) {
331
- if (this -> isSwiftVersionAtLeast (*version)) {
331
+ if (isSwiftVersionAtLeast (*version)) {
332
332
return FeatureState (feature, FeatureState::Kind::Enabled);
333
333
}
334
334
}
@@ -337,7 +337,7 @@ LangOptions::FeatureState LangOptions::getFeatureState(Feature feature) const {
337
337
}
338
338
339
339
bool LangOptions::hasFeature (Feature feature) const {
340
- if (this -> featureStates .getState (feature).isEnabled ())
340
+ if (featureStates.getState (feature).isEnabled ())
341
341
return true ;
342
342
343
343
if (auto version = getFeatureLanguageVersion (feature))
@@ -361,15 +361,14 @@ bool LangOptions::hasFeature(llvm::StringRef featureName) const {
361
361
void LangOptions::enableFeature (Feature feature, bool forAdoption) {
362
362
if (forAdoption) {
363
363
ASSERT (isFeatureAdoptable (feature));
364
- this ->featureStates .setState (feature,
365
- FeatureState::Kind::EnabledForAdoption);
364
+ featureStates.setState (feature, FeatureState::Kind::EnabledForAdoption);
366
365
} else {
367
- this -> featureStates .setState (feature, FeatureState::Kind::Enabled);
366
+ featureStates.setState (feature, FeatureState::Kind::Enabled);
368
367
}
369
368
}
370
369
371
370
void LangOptions::disableFeature (Feature feature) {
372
- this -> featureStates .setState (feature, FeatureState::Kind::Off);
371
+ featureStates.setState (feature, FeatureState::Kind::Off);
373
372
}
374
373
375
374
void LangOptions::setHasAtomicBitWidth (llvm::Triple triple) {
0 commit comments