mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Basic] hasFeature should succeed for promoted language features
Merge `$<Feature>` and `hasFeature` implementations.
- `$<Feature>` did not support upcoming language features.
- `hasFeature` did not support promoted language features and also
didn't take into account `Options` in `Features.def`.
Remove `Options` entirely, it was always one of three cases:
- `true`
- `langOpts.hasFeature`
- `hasSwiftSwiftParser`
Since `LangOptions::hasFeature` should always be used anyway, it's no
longer necessary. `hasSwiftSwiftParser` can be special cased when adding
the default promoted language features (by removing those features).
Resolves rdar://117917456.
This commit is contained in:
@@ -1624,8 +1624,8 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
});
|
||||
|
||||
if (LangOpts.hasFeature(Feature::LayoutPrespecialization)) {
|
||||
genericSubInvocation.getLangOptions().Features.insert(
|
||||
Feature::LayoutPrespecialization);
|
||||
genericSubInvocation.getLangOptions().enableFeature(
|
||||
Feature::LayoutPrespecialization);
|
||||
}
|
||||
|
||||
// Validate Clang modules once per-build session flags must be consistent
|
||||
|
||||
Reference in New Issue
Block a user