Skip to content

Commit 90d1365

Browse files
committed
[NFC] Frontend: Give some variables better names
1 parent c91e295 commit 90d1365

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

lib/Frontend/CompilerInvocation.cpp

+12-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -750,31 +750,32 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
750750
OPT_enable_upcoming_feature, OPT_disable_upcoming_feature)) {
751751
auto &option = A->getOption();
752752
StringRef value = A->getValue();
753-
bool enableUpcoming = option.matches(OPT_enable_upcoming_feature);
754-
bool isUpcomingFlag =
755-
enableUpcoming || option.matches(OPT_disable_upcoming_feature);
756-
bool enableFeature =
757-
enableUpcoming || option.matches(OPT_enable_experimental_feature);
753+
bool isEnableUpcomingFeatureFlag =
754+
option.matches(OPT_enable_upcoming_feature);
755+
bool isUpcomingFeatureFlag = isEnableUpcomingFeatureFlag ||
756+
option.matches(OPT_disable_upcoming_feature);
757+
bool isEnableFeatureFlag = isEnableUpcomingFeatureFlag ||
758+
option.matches(OPT_enable_experimental_feature);
758759

759760
// Collect some special case pseudo-features which should be processed
760761
// separately.
761762
if (value.starts_with("StrictConcurrency") ||
762763
value.starts_with("AvailabilityMacro=")) {
763-
if (enableFeature)
764+
if (isEnableFeatureFlag)
764765
psuedoFeatures.push_back(value);
765766
continue;
766767
}
767768

768769
auto feature = getUpcomingFeature(value);
769770
if (feature) {
770771
// Diagnose upcoming features enabled with -enable-experimental-feature.
771-
if (!isUpcomingFlag)
772+
if (!isUpcomingFeatureFlag)
772773
Diags.diagnose(SourceLoc(), diag::feature_not_experimental, value,
773-
enableFeature);
774+
isEnableFeatureFlag);
774775
} else {
775776
// If -enable-upcoming-feature was used and an upcoming feature was not
776777
// found, diagnose and continue.
777-
if (isUpcomingFlag) {
778+
if (isUpcomingFeatureFlag) {
778779
Diags.diagnose(SourceLoc(), diag::unrecognized_feature, value,
779780
/*upcoming=*/true);
780781
continue;
@@ -815,7 +816,7 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
815816
}
816817

817818
// Enable the feature if requested.
818-
if (enableFeature)
819+
if (isEnableFeatureFlag)
819820
Opts.enableFeature(*feature);
820821
}
821822

0 commit comments

Comments
 (0)