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:
Allan Shortlidge
2025-08-28 09:14:40 -07:00
parent 61cb1a9126
commit a5a49aaab6
2 changed files with 5 additions and 14 deletions

View File

@@ -354,14 +354,7 @@ static bool usesFeatureCoroutineAccessors(Decl *decl) {
}
UNINTERESTING_FEATURE(GeneralizedIsSameMetaTypeBuiltin)
static bool usesFeatureCustomAvailability(Decl *decl) {
for (auto attr : decl->getSemanticAvailableAttrs()) {
if (attr.getDomain().isCustom())
return true;
}
return false;
}
UNINTERESTING_FEATURE(CustomAvailability)
static bool usesFeatureAsyncExecutionBehaviorAttributes(Decl *decl) {
// Explicit `@concurrent` attribute on the declaration.

View File

@@ -15,18 +15,16 @@
import Oceans // re-exports Rivers
// CHECK: #if compiler(>=5.3) && $CustomAvailability
// CHECK-NEXT: @available(Colorado)
// CHECK-NOT: $CustomAvailability
// CHECK: @available(Colorado)
// CHECK-NEXT: public func availableInColorado()
// CHECK-NEXT: #endif
@available(Colorado)
public func availableInColorado() { }
// CHECK: #if compiler(>=5.3) && $CustomAvailability
// CHECK-NEXT: @available(Arctic, unavailable)
// CHECK: @available(Arctic, unavailable)
// CHECK-NEXT: @available(Pacific)
// CHECK-NEXT: public func unavailableInArcticButAvailableInPacific()
// CHECK-NEXT: #endif
@available(Arctic, unavailable)
@available(Pacific)
public func unavailableInArcticButAvailableInPacific() { }