@@ -147,6 +147,11 @@ class DeclAttribute : public AttributeBase {
147147 Value : 32
148148 );
149149
150+ SWIFT_INLINE_BITFIELD (AvailableAttr, DeclAttribute, 1 ,
151+ // / Whether this attribute was spelled `@_spi_available`.
152+ IsSPI : 1
153+ );
154+
150155 SWIFT_INLINE_BITFIELD (ClangImporterSynthesizedTypeAttr, DeclAttribute, 1 ,
151156 kind : 1
152157 );
@@ -690,7 +695,9 @@ class AvailableAttr : public DeclAttribute {
690695 INIT_VER_TUPLE(Introduced), IntroducedRange(IntroducedRange),
691696 INIT_VER_TUPLE(Deprecated), DeprecatedRange(DeprecatedRange),
692697 INIT_VER_TUPLE(Obsoleted), ObsoletedRange(ObsoletedRange),
693- PlatformAgnostic(PlatformAgnostic), Platform(Platform), IsSPI(IsSPI) {}
698+ PlatformAgnostic(PlatformAgnostic), Platform(Platform) {
699+ Bits.AvailableAttr .IsSPI = IsSPI;
700+ }
694701
695702#undef INIT_VER_TUPLE
696703
@@ -735,9 +742,6 @@ class AvailableAttr : public DeclAttribute {
735742 // / The platform of the availability.
736743 const PlatformKind Platform;
737744
738- // / Whether this is available as SPI.
739- const bool IsSPI;
740-
741745 // / Whether this is a language-version-specific entity.
742746 bool isLanguageVersionSpecific () const ;
743747
@@ -753,6 +757,9 @@ class AvailableAttr : public DeclAttribute {
753757 // / Whether this is a noasync attribute.
754758 bool isNoAsync () const ;
755759
760+ // / Whether this attribute was spelled `@_spi_available`.
761+ bool isSPI () const { return Bits.AvailableAttr .IsSPI ; }
762+
756763 // / Returns the platform-agnostic availability.
757764 PlatformAgnosticAvailabilityKind getPlatformAgnosticAvailability () const {
758765 return PlatformAgnostic;
0 commit comments