mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Use availability to control decl visibility in public swiftinterfaces.
Declarations that are unavailable at runtime because of an `@available` attribute referencing a custom domain that was imported `@_spiOnly` should be hidden from public swiftinterface files in `-library-level=api` modules. For remaining declarations that do get printed in the public swiftinterface, skip printing any `@available` attribute that refers to the domains from those `@_spiOnly` dependencies. This allows API developers to control declaration visibility using availability defined by another module. Resolves rdar://156512028.
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#include <availability_domain.h>
|
||||
|
||||
int huron_pred(void);
|
||||
|
||||
CLANG_ENABLED_AVAILABILITY_DOMAIN(Salt);
|
||||
CLANG_DISABLED_AVAILABILITY_DOMAIN(Erie);
|
||||
CLANG_DYNAMIC_AVAILABILITY_DOMAIN(Huron, huron_pred);
|
||||
|
||||
#define AVAIL 0
|
||||
#define UNAVAIL 1
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#include <availability_domain.h>
|
||||
|
||||
int aegean_pred(void);
|
||||
|
||||
CLANG_ENABLED_AVAILABILITY_DOMAIN(Baltic);
|
||||
CLANG_DISABLED_AVAILABILITY_DOMAIN(Mediterranean);
|
||||
CLANG_DYNAMIC_AVAILABILITY_DOMAIN(Aegean, aegean_pred);
|
||||
|
||||
#define AVAIL 0
|
||||
#define UNAVAIL 1
|
||||
|
||||
Reference in New Issue
Block a user