LangOptions: Refactor feature state and API to account for adoption mode

This commit is contained in:
Anthony Latsis
2025-02-21 15:33:04 +00:00
parent 2a88419f5c
commit 2771f36ced
9 changed files with 247 additions and 123 deletions

View File

@@ -847,9 +847,6 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
option.getPrefixedName(), argValue);
continue;
}
// Adoption mode is not plumbed through; ignore it.
continue;
}
// Skip features that are already enabled or disabled.
@@ -858,7 +855,7 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
// Enable the feature if requested.
if (isEnableFeatureFlag)
Opts.enableFeature(*feature);
Opts.enableFeature(*feature, /*forAdoption=*/featureMode.has_value());
}
// Since pseudo-features don't have a boolean on/off state, process them in