mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ModuleInterface: Stop printing $CustomAvailability guards in swiftinterfaces.
All supported compilers can now parse `@available` attributes that reference custom availability domains.
This commit is contained in:
@@ -354,14 +354,7 @@ static bool usesFeatureCoroutineAccessors(Decl *decl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNINTERESTING_FEATURE(GeneralizedIsSameMetaTypeBuiltin)
|
UNINTERESTING_FEATURE(GeneralizedIsSameMetaTypeBuiltin)
|
||||||
|
UNINTERESTING_FEATURE(CustomAvailability)
|
||||||
static bool usesFeatureCustomAvailability(Decl *decl) {
|
|
||||||
for (auto attr : decl->getSemanticAvailableAttrs()) {
|
|
||||||
if (attr.getDomain().isCustom())
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool usesFeatureAsyncExecutionBehaviorAttributes(Decl *decl) {
|
static bool usesFeatureAsyncExecutionBehaviorAttributes(Decl *decl) {
|
||||||
// Explicit `@concurrent` attribute on the declaration.
|
// Explicit `@concurrent` attribute on the declaration.
|
||||||
|
|||||||
@@ -15,18 +15,16 @@
|
|||||||
|
|
||||||
import Oceans // re-exports Rivers
|
import Oceans // re-exports Rivers
|
||||||
|
|
||||||
// CHECK: #if compiler(>=5.3) && $CustomAvailability
|
// CHECK-NOT: $CustomAvailability
|
||||||
// CHECK-NEXT: @available(Colorado)
|
|
||||||
|
// CHECK: @available(Colorado)
|
||||||
// CHECK-NEXT: public func availableInColorado()
|
// CHECK-NEXT: public func availableInColorado()
|
||||||
// CHECK-NEXT: #endif
|
|
||||||
@available(Colorado)
|
@available(Colorado)
|
||||||
public func availableInColorado() { }
|
public func availableInColorado() { }
|
||||||
|
|
||||||
// CHECK: #if compiler(>=5.3) && $CustomAvailability
|
// CHECK: @available(Arctic, unavailable)
|
||||||
// CHECK-NEXT: @available(Arctic, unavailable)
|
|
||||||
// CHECK-NEXT: @available(Pacific)
|
// CHECK-NEXT: @available(Pacific)
|
||||||
// CHECK-NEXT: public func unavailableInArcticButAvailableInPacific()
|
// CHECK-NEXT: public func unavailableInArcticButAvailableInPacific()
|
||||||
// CHECK-NEXT: #endif
|
|
||||||
@available(Arctic, unavailable)
|
@available(Arctic, unavailable)
|
||||||
@available(Pacific)
|
@available(Pacific)
|
||||||
public func unavailableInArcticButAvailableInPacific() { }
|
public func unavailableInArcticButAvailableInPacific() { }
|
||||||
|
|||||||
Reference in New Issue
Block a user