From 7c867ca1dadf9a33d889f49d447507c425e686d6 Mon Sep 17 00:00:00 2001 From: Becca Royal-Gordon Date: Fri, 7 Mar 2025 20:17:44 -0800 Subject: [PATCH] [NFC] Split DeclAttrOptions into two types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re running out of bits in DeclAttrOptions, so split it in two: DeclAttrRequirements contains all the `On*` options that describe the declarations allowed to have the attribute, while the other options are now DeclAttrBehaviors. This commit also sorts the entries in DeclAttr.def by serialization code and improves the formatting of the file. --- include/swift/AST/Attr.h | 104 +-- include/swift/AST/DeclAttr.def | 789 +++++++++++++++------- lib/AST/ASTPrinter.cpp | 4 +- lib/AST/Attr.cpp | 65 +- lib/Parse/ParseDecl.cpp | 2 +- lib/Sema/TypeCheckAttr.cpp | 2 +- lib/Serialization/DeclTypeRecordNodes.def | 2 +- lib/SymbolGraphGen/SymbolGraph.cpp | 2 +- 8 files changed, 650 insertions(+), 320 deletions(-) diff --git a/include/swift/AST/Attr.h b/include/swift/AST/Attr.h index 37e4fbe7fd64b..685eab1416dcc 100644 --- a/include/swift/AST/Attr.h +++ b/include/swift/AST/Attr.h @@ -42,6 +42,7 @@ #include "swift/Basic/SourceLoc.h" #include "swift/Basic/UUID.h" #include "swift/Basic/Version.h" +#include "llvm/ADT/bit.h" #include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -264,7 +265,7 @@ class DeclAttribute : public AttributeBase { }; public: - enum DeclAttrOptions : uint64_t { + enum DeclAttrRequirements : uint64_t { // There is one entry for each DeclKind, and some higher level buckets // below. These are used in Attr.def to control which kinds of declarations // an attribute can be attached to. @@ -303,71 +304,80 @@ class DeclAttribute : public AttributeBase { #include "swift/AST/DeclNodes.def" , + /// Whether this attribute is valid on additional decls in ClangImporter. + OnAnyClangDecl = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 1), + }; + + static_assert( + (unsigned(DeclKindIndex::Last_Decl) + 1) < 64, + "Overflow decl attr requirement bitfields"); + + enum DeclAttrBehaviors : uint64_t { + /// Whether this attribute is only valid when concurrency is enabled. + ConcurrencyOnly = 1ull << 0, + /// True if multiple instances of this attribute are allowed on a single /// declaration. - AllowMultipleAttributes = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 1), + AllowMultipleAttributes = 1ull << 1, /// True if this is a decl modifier - i.e., that it should not be spelled /// with an @. - DeclModifier = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 2), + DeclModifier = 1ull << 2, /// True if this is a long attribute that should be printed on its own line. /// /// Currently has no effect on DeclModifier attributes. - LongAttribute = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 3), + LongAttribute = 1ull << 3, /// True if this shouldn't be serialized. - NotSerialized = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 4), + NotSerialized = 1ull << 4, /// True if this attribute is only valid when parsing a .sil file. - SILOnly = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 5), + SILOnly = 1ull << 5, /// The attribute should be reported by parser as unknown. - RejectByParser = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 6), + RejectByParser = 1ull << 6, - /// Whether client code cannot use the attribute. - UserInaccessible = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 7), + /// Whether client code cannot use the attribute. Hides it in code completion. + UserInaccessible = 1ull << 7, /// Whether adding this attribute can break API - APIBreakingToAdd = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 8), + APIBreakingToAdd = 1ull << 8, /// Whether removing this attribute can break API - APIBreakingToRemove = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 9), + APIBreakingToRemove = 1ull << 9, /// Whether adding this attribute can break ABI - ABIBreakingToAdd = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 10), + ABIBreakingToAdd = 1ull << 10, /// Whether removing this attribute can break ABI - ABIBreakingToRemove = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 11), + ABIBreakingToRemove = 1ull << 11, /// The opposite of APIBreakingToAdd - APIStableToAdd = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 12), + APIStableToAdd = 1ull << 12, /// The opposite of APIBreakingToRemove - APIStableToRemove = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 13), + APIStableToRemove = 1ull << 13, /// The opposite of ABIBreakingToAdd - ABIStableToAdd = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 14), + ABIStableToAdd = 1ull << 14, /// The opposite of ABIBreakingToRemove - ABIStableToRemove = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 15), - - /// Whether this attribute is only valid when concurrency is enabled. - ConcurrencyOnly = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 16), - - /// Whether this attribute is valid on additional decls in ClangImporter. - OnAnyClangDecl = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 17), + ABIStableToRemove = 1ull << 15, }; - static_assert( - (unsigned(DeclKindIndex::Last_Decl) + 17) < 64, - "Overflow decl attr options bitfields"); + LLVM_READNONE + static uint64_t getRequirements(DeclAttrKind DK); + + uint64_t getRequirements() const { + return getRequirements(getKind()); + } LLVM_READNONE - static uint64_t getOptions(DeclAttrKind DK); + static uint64_t getBehaviors(DeclAttrKind DK); - uint64_t getOptions() const { - return getOptions(getKind()); + uint64_t getBehaviors() const { + return getBehaviors(getKind()); } /// Prints this attribute (if applicable), returning `true` if anything was @@ -433,74 +443,74 @@ class DeclAttribute : public AttributeBase { /// Returns true if multiple instances of an attribute kind /// can appear on a declaration. static bool allowMultipleAttributes(DeclAttrKind DK) { - return getOptions(DK) & AllowMultipleAttributes; + return getBehaviors(DK) & AllowMultipleAttributes; } bool isLongAttribute() const { return isLongAttribute(getKind()); } static bool isLongAttribute(DeclAttrKind DK) { - return getOptions(DK) & LongAttribute; + return getBehaviors(DK) & LongAttribute; } static bool shouldBeRejectedByParser(DeclAttrKind DK) { - return getOptions(DK) & RejectByParser; + return getBehaviors(DK) & RejectByParser; } static bool isSilOnly(DeclAttrKind DK) { - return getOptions(DK) & SILOnly; + return getBehaviors(DK) & SILOnly; } static bool isConcurrencyOnly(DeclAttrKind DK) { - return getOptions(DK) & ConcurrencyOnly; + return getBehaviors(DK) & ConcurrencyOnly; } static bool isUserInaccessible(DeclAttrKind DK) { - return getOptions(DK) & UserInaccessible; + return getBehaviors(DK) & UserInaccessible; } static bool isAddingBreakingABI(DeclAttrKind DK) { - return getOptions(DK) & ABIBreakingToAdd; + return getBehaviors(DK) & ABIBreakingToAdd; } -#define DECL_ATTR(_, CLASS, OPTIONS, ...) \ - static constexpr bool isOptionSetFor##CLASS(DeclAttrOptions Bit) { \ - return (OPTIONS) & Bit; \ +#define DECL_ATTR(_, CLASS, REQUIREMENTS, BEHAVIORS, ...) \ + static constexpr bool hasOneBehaviorFor##CLASS(uint64_t Mask) { \ + return llvm::has_single_bit((BEHAVIORS) & Mask); \ } #include "swift/AST/DeclAttr.def" static bool isAddingBreakingAPI(DeclAttrKind DK) { - return getOptions(DK) & APIBreakingToAdd; + return getBehaviors(DK) & APIBreakingToAdd; } static bool isRemovingBreakingABI(DeclAttrKind DK) { - return getOptions(DK) & ABIBreakingToRemove; + return getBehaviors(DK) & ABIBreakingToRemove; } static bool isRemovingBreakingAPI(DeclAttrKind DK) { - return getOptions(DK) & APIBreakingToRemove; + return getBehaviors(DK) & APIBreakingToRemove; } bool isDeclModifier() const { return isDeclModifier(getKind()); } static bool isDeclModifier(DeclAttrKind DK) { - return getOptions(DK) & DeclModifier; + return getBehaviors(DK) & DeclModifier; } static bool isOnParam(DeclAttrKind DK) { - return getOptions(DK) & OnParam; + return getRequirements(DK) & OnParam; } static bool isOnFunc(DeclAttrKind DK) { - return getOptions(DK) & OnFunc; + return getRequirements(DK) & OnFunc; } static bool isOnClass(DeclAttrKind DK) { - return getOptions(DK) & OnClass; + return getRequirements(DK) & OnClass; } static bool isNotSerialized(DeclAttrKind DK) { - return getOptions(DK) & NotSerialized; + return getBehaviors(DK) & NotSerialized; } bool isNotSerialized() const { return isNotSerialized(getKind()); diff --git a/include/swift/AST/DeclAttr.def b/include/swift/AST/DeclAttr.def index 52f77e5a7d5c2..79e7f461eb293 100644 --- a/include/swift/AST/DeclAttr.def +++ b/include/swift/AST/DeclAttr.def @@ -15,22 +15,22 @@ //===----------------------------------------------------------------------===// #ifndef DECL_ATTR -#define DECL_ATTR(SPELLING, CLASS, OPTIONS, CODE) +#define DECL_ATTR(SPELLING, CLASS, REQUIREMENTS, BEHAVIORS, CODE) #endif #ifndef CONTEXTUAL_DECL_ATTR -#define CONTEXTUAL_DECL_ATTR(SPELLING, CLASS, OPTIONS, CODE) \ - DECL_ATTR(SPELLING, CLASS, OPTIONS, CODE) +#define CONTEXTUAL_DECL_ATTR(SPELLING, CLASS, REQUIREMENTS, BEHAVIORS, CODE) \ + DECL_ATTR(SPELLING, CLASS, REQUIREMENTS, BEHAVIORS, CODE) #endif #ifndef SIMPLE_DECL_ATTR -#define SIMPLE_DECL_ATTR(X, CLASS, OPTIONS, CODE) \ - DECL_ATTR(X, CLASS, OPTIONS, CODE) +#define SIMPLE_DECL_ATTR(X, CLASS, REQUIREMENTS, BEHAVIORS, CODE) \ + DECL_ATTR(X, CLASS, REQUIREMENTS, BEHAVIORS, CODE) #endif #ifndef CONTEXTUAL_SIMPLE_DECL_ATTR -#define CONTEXTUAL_SIMPLE_DECL_ATTR(X, CLASS, OPTIONS, CODE) \ - SIMPLE_DECL_ATTR(X, CLASS, OPTIONS, CODE) +#define CONTEXTUAL_SIMPLE_DECL_ATTR(X, CLASS, REQUIREMENTS, BEHAVIORS, CODE) \ + SIMPLE_DECL_ATTR(X, CLASS, REQUIREMENTS, BEHAVIORS, CODE) #endif #ifndef DECL_ATTR_ALIAS @@ -56,453 +56,769 @@ #define LAST_DECL_ATTR(CLASS) #endif +// // Declaration Attributes and Modifers +// +// Please keep entries in serialization code order. If you remove an entry, +// leave an "Unused 'NNN'" comment so the unused code is obvious. DECL_ATTR(_silgen_name, SILGenName, - OnAbstractFunction | OnVar | LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnVar, + LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 0) + DECL_ATTR(available, Available, - OnAbstractFunction | OnAssociatedType | OnGenericType | OnVar | OnSubscript | OnEnumElement | OnMacro | OnExtension | AllowMultipleAttributes | LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnAssociatedType | OnGenericType | OnVar | OnSubscript | OnEnumElement | OnMacro | OnExtension, + AllowMultipleAttributes | LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 1) + +CONTEXTUAL_SIMPLE_DECL_ATTR(final, Final, + OnClass | OnFunc | OnAccessor | OnVar | OnSubscript, + DeclModifier | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + 2) + DECL_ATTR(objc, ObjC, - OnAbstractFunction | OnClass | OnProtocol | OnExtension | OnVar | OnSubscript | OnEnum | OnEnumElement | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnClass | OnProtocol | OnExtension | OnVar | OnSubscript | OnEnum | OnEnumElement, + ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 3) + +CONTEXTUAL_SIMPLE_DECL_ATTR(required, Required, + OnConstructor, + DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 4) + +CONTEXTUAL_SIMPLE_DECL_ATTR(optional, Optional, + OnConstructor | OnFunc | OnAccessor | OnVar | OnSubscript, + DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 5) + SIMPLE_DECL_ATTR(dynamicCallable, DynamicCallable, - OnNominalType | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnNominalType, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 6) + SIMPLE_DECL_ATTR(main, MainType, - OnClass | OnStruct | OnEnum | OnExtension | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass | OnStruct | OnEnum | OnExtension, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 7) + SIMPLE_DECL_ATTR(_exported, Exported, - OnImport | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnImport, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 8) + SIMPLE_DECL_ATTR(dynamicMemberLookup, DynamicMemberLookup, - OnNominalType | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnNominalType, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 9) + SIMPLE_DECL_ATTR(NSCopying, NSCopying, - OnVar | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 10) + SIMPLE_DECL_ATTR(IBAction, IBAction, - OnFunc | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 11) + SIMPLE_DECL_ATTR(IBDesignable, IBDesignable, - OnClass | OnExtension | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass | OnExtension, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 12) + SIMPLE_DECL_ATTR(IBInspectable, IBInspectable, - OnVar | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 13) + SIMPLE_DECL_ATTR(IBOutlet, IBOutlet, - OnVar | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 14) + SIMPLE_DECL_ATTR(NSManaged, NSManaged, - OnVar | OnFunc | OnAccessor | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar | OnFunc | OnAccessor, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 15) + +CONTEXTUAL_SIMPLE_DECL_ATTR(lazy, Lazy, + OnVar, + DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 16) + SIMPLE_DECL_ATTR(LLDBDebuggerFunction, LLDBDebuggerFunction, - OnFunc | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 17) + SIMPLE_DECL_ATTR(UIApplicationMain, UIApplicationMain, - OnClass | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 18) + SIMPLE_DECL_ATTR(unsafe_no_objc_tagged_pointer, UnsafeNoObjCTaggedPointer, - OnProtocol | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnProtocol, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 19) + DECL_ATTR(inline, Inline, - OnVar | OnSubscript | OnAbstractFunction | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar | OnSubscript | OnAbstractFunction, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 20) + DECL_ATTR(_semantics, Semantics, - OnAbstractFunction | OnSubscript | OnNominalType | OnVar | AllowMultipleAttributes | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript | OnNominalType | OnVar, + AllowMultipleAttributes | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 21) + +CONTEXTUAL_SIMPLE_DECL_ATTR(dynamic, Dynamic, + OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor, + DeclModifier | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + 22) + +CONTEXTUAL_SIMPLE_DECL_ATTR(infix, Infix, + OnFunc | OnOperator, + DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 23) + +CONTEXTUAL_SIMPLE_DECL_ATTR(prefix, Prefix, + OnFunc | OnOperator, + DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 24) + +CONTEXTUAL_SIMPLE_DECL_ATTR(postfix, Postfix, + OnFunc | OnOperator, + DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 25) + SIMPLE_DECL_ATTR(_transparent, Transparent, - OnFunc | OnAccessor | OnConstructor | OnVar | OnDestructor | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc | OnAccessor | OnConstructor | OnVar | OnDestructor, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 26) + SIMPLE_DECL_ATTR(requires_stored_property_inits, RequiresStoredPropertyInits, - OnClass | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 27) + +// Unused '28' +// Unused '29' + SIMPLE_DECL_ATTR(nonobjc, NonObjC, - OnExtension | OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnExtension | OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 30) + SIMPLE_DECL_ATTR(_fixed_layout, FixedLayout, - OnVar | OnClass | OnStruct | OnProtocol | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnVar | OnClass | OnStruct | OnProtocol, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 31) + SIMPLE_DECL_ATTR(inlinable, Inlinable, - OnVar | OnSubscript | OnAbstractFunction | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar | OnSubscript | OnAbstractFunction, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 32) + DECL_ATTR(_specialize, Specialize, - OnConstructor | OnFunc | OnAccessor | AllowMultipleAttributes | LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnConstructor | OnFunc | OnAccessor, + AllowMultipleAttributes | LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 33) + SIMPLE_DECL_ATTR(objcMembers, ObjCMembers, - OnClass | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 34) + CONTEXTUAL_SIMPLE_DECL_ATTR(_compilerInitialized, CompilerInitialized, - OnVar | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 35) + +SIMPLE_DECL_ATTR(_lexicalLifetimes, LexicalLifetimes, + OnFunc, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 36) + +// Unused '37' +// Unused '38' +// Unused '39' + +CONTEXTUAL_SIMPLE_DECL_ATTR(__consuming, LegacyConsuming, + OnFunc | OnAccessor, + DeclModifier | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 40) + +CONTEXTUAL_SIMPLE_DECL_ATTR(mutating, Mutating, + OnFunc | OnAccessor, + DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 41) + +CONTEXTUAL_SIMPLE_DECL_ATTR(nonmutating, NonMutating, + OnFunc | OnAccessor, + DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 42) + +CONTEXTUAL_SIMPLE_DECL_ATTR(convenience, Convenience, + OnConstructor, + DeclModifier | NotSerialized | ABIBreakingToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 43) + +CONTEXTUAL_SIMPLE_DECL_ATTR(override, Override, + OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor | OnAssociatedType, + DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 44) + SIMPLE_DECL_ATTR(_hasStorage, HasStorage, - OnVar | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 45) + +DECL_ATTR(private, AccessControl, + OnFunc | OnAccessor | OnExtension | OnGenericType | OnVar | OnSubscript | OnConstructor | OnMacro | OnImport, + DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 46) +DECL_ATTR_ALIAS(fileprivate, AccessControl) +DECL_ATTR_ALIAS(internal, AccessControl) +DECL_ATTR_ALIAS(public, AccessControl) +CONTEXTUAL_DECL_ATTR_ALIAS(package, AccessControl) +CONTEXTUAL_DECL_ATTR_ALIAS(open, AccessControl) + +DECL_ATTR(__setter_access, SetterAccess, + OnVar | OnSubscript, + DeclModifier | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 47) + DECL_ATTR(__raw_doc_comment, RawDocComment, - OnAnyDecl | UserInaccessible | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAnyDecl, + UserInaccessible | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 48) + +CONTEXTUAL_DECL_ATTR(weak, ReferenceOwnership, + OnVar, + DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + 49) +CONTEXTUAL_DECL_ATTR_ALIAS(unowned, ReferenceOwnership) + DECL_ATTR(_effects, Effects, - OnAbstractFunction | AllowMultipleAttributes | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction, + AllowMultipleAttributes | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 50) + DECL_ATTR(__objc_bridged, ObjCBridged, - OnClass | UserInaccessible | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + UserInaccessible | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 51) + SIMPLE_DECL_ATTR(NSApplicationMain, NSApplicationMain, - OnClass | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 52) + SIMPLE_DECL_ATTR(_objc_non_lazy_realization, ObjCNonLazyRealization, - OnClass | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 53) + DECL_ATTR(__synthesized_protocol, SynthesizedProtocol, - OnConcreteNominalType | UserInaccessible | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnConcreteNominalType, + UserInaccessible | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 54) + SIMPLE_DECL_ATTR(testable, Testable, - OnImport | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnImport, + UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 55) + DECL_ATTR(_alignment, Alignment, - OnStruct | OnEnum | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnStruct | OnEnum, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 56) + +SIMPLE_DECL_ATTR(rethrows, Rethrows, + OnFunc | OnConstructor, + DeclModifier | RejectByParser | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + 57) + SIMPLE_DECL_ATTR(rethrows, AtRethrows, - OnProtocol | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnProtocol, + ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 58) + DECL_ATTR(_swift_native_objc_runtime_base, SwiftNativeObjCRuntimeBase, - OnClass | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 59) + +CONTEXTUAL_SIMPLE_DECL_ATTR(indirect, Indirect, + OnEnum | OnEnumElement, + DeclModifier | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + 60) + SIMPLE_DECL_ATTR(warn_unqualified_access, WarnUnqualifiedAccess, - OnFunc | OnAccessor | LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc | OnAccessor, + LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 61) + SIMPLE_DECL_ATTR(_show_in_interface, ShowInInterface, - OnProtocol | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnProtocol, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 62) + DECL_ATTR(_cdecl, CDecl, - OnFunc | OnAccessor | LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc | OnAccessor, + LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 63) + SIMPLE_DECL_ATTR(usableFromInline, UsableFromInline, - OnAbstractFunction | OnVar | OnSubscript | OnNominalType | OnTypeAlias | LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnVar | OnSubscript | OnNominalType | OnTypeAlias, + LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 64) + SIMPLE_DECL_ATTR(discardableResult, DiscardableResult, - OnFunc | OnAccessor | OnConstructor | OnMacro | LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc | OnAccessor | OnConstructor | OnMacro, + LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 65) + SIMPLE_DECL_ATTR(GKInspectable, GKInspectable, - OnVar | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 66) + DECL_ATTR(_implements, Implements, - OnFunc | OnAccessor | OnVar | OnSubscript | OnTypeAlias | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc | OnAccessor | OnVar | OnSubscript | OnTypeAlias, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 67) + DECL_ATTR(_objcRuntimeName, ObjCRuntimeName, - OnClass | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 68) + SIMPLE_DECL_ATTR(_staticInitializeObjCMetadata, StaticInitializeObjCMetadata, - OnClass | UserInaccessible | LongAttribute | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass, + UserInaccessible | LongAttribute | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 69) + DECL_ATTR(_restatedObjCConformance, RestatedObjCConformance, - OnProtocol | UserInaccessible | LongAttribute | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnProtocol, + UserInaccessible | LongAttribute | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 70) + +// Unused '71' + DECL_ATTR(implementation, ObjCImplementation, - OnExtension | OnAbstractFunction | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnExtension | OnAbstractFunction, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 72) DECL_ATTR_ALIAS(_objcImplementation, ObjCImplementation) + DECL_ATTR(_optimize, Optimize, - OnAbstractFunction | OnSubscript | OnVar | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript | OnVar, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 73) + DECL_ATTR(_clangImporterSynthesizedType, ClangImporterSynthesizedType, - OnGenericType | LongAttribute | RejectByParser | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnGenericType, + LongAttribute | RejectByParser | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 74) + SIMPLE_DECL_ATTR(_weakLinked, WeakLinked, - OnNominalType | OnAssociatedType | OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor | OnEnumElement | OnExtension | OnImport | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnNominalType | OnAssociatedType | OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor | OnEnumElement | OnExtension | OnImport, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 75) + SIMPLE_DECL_ATTR(frozen, Frozen, - OnEnum | OnStruct | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToRemove | APIStableToAdd, + OnEnum | OnStruct, + ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToRemove | APIStableToAdd, 76) + DECL_ATTR_ALIAS(_frozen, Frozen) SIMPLE_DECL_ATTR(_forbidSerializingReference, ForbidSerializingReference, - OnAnyDecl | LongAttribute | RejectByParser | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAnyDecl, + LongAttribute | RejectByParser | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 77) + SIMPLE_DECL_ATTR(_hasInitialValue, HasInitialValue, - OnVar | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 78) + SIMPLE_DECL_ATTR(_nonoverride, NonOverride, - OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor | OnAssociatedType | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor | OnAssociatedType, + UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 79) + DECL_ATTR(_dynamicReplacement, DynamicReplacement, - OnAbstractFunction | OnVar | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnVar | OnSubscript, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 80) + SIMPLE_DECL_ATTR(_borrowed, Borrowed, - OnVar | OnSubscript | UserInaccessible | NotSerialized | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnVar | OnSubscript, + UserInaccessible | NotSerialized | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 81) + DECL_ATTR(_private, PrivateImport, - OnImport | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnImport, + UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 82) + SIMPLE_DECL_ATTR(_alwaysEmitIntoClient, AlwaysEmitIntoClient, - OnVar | OnSubscript | OnAbstractFunction | UserInaccessible | ABIBreakingToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar | OnSubscript | OnAbstractFunction, + UserInaccessible | ABIBreakingToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 83) + SIMPLE_DECL_ATTR(_implementationOnly, ImplementationOnly, - OnImport | OnFunc | OnConstructor | OnVar | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnImport | OnFunc | OnConstructor | OnVar | OnSubscript, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 84) + DECL_ATTR(_custom, Custom, - OnAnyDecl | RejectByParser | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAnyDecl, + RejectByParser | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 85) + SIMPLE_DECL_ATTR(propertyWrapper, PropertyWrapper, - OnStruct | OnClass | OnEnum | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnStruct | OnClass | OnEnum, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 86) + SIMPLE_DECL_ATTR(_disfavoredOverload, DisfavoredOverload, - OnAbstractFunction | OnVar | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnVar | OnSubscript, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 87) + SIMPLE_DECL_ATTR(resultBuilder, ResultBuilder, - OnNominalType | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnNominalType, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 88) + DECL_ATTR(_projectedValueProperty, ProjectedValueProperty, - OnVar | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 89) + SIMPLE_DECL_ATTR(_nonEphemeral, NonEphemeral, - OnParam | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, + OnParam, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, 90) + DECL_ATTR(differentiable, Differentiable, - OnAccessor | OnConstructor | OnFunc | OnVar | OnSubscript | LongAttribute | AllowMultipleAttributes | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, + OnAccessor | OnConstructor | OnFunc | OnVar | OnSubscript, + LongAttribute | AllowMultipleAttributes | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, 91) + SIMPLE_DECL_ATTR(_hasMissingDesignatedInitializers, HasMissingDesignatedInitializers, - OnClass | UserInaccessible | NotSerialized | APIBreakingToAdd | ABIBreakingToAdd | APIStableToRemove | ABIStableToRemove, + OnClass, + UserInaccessible | NotSerialized | APIBreakingToAdd | ABIBreakingToAdd | APIStableToRemove | ABIStableToRemove, 92) + SIMPLE_DECL_ATTR(_inheritsConvenienceInitializers, InheritsConvenienceInitializers, - OnClass | UserInaccessible | NotSerialized | APIStableToAdd | ABIStableToAdd | APIBreakingToRemove | ABIBreakingToRemove, + OnClass, + UserInaccessible | NotSerialized | APIStableToAdd | ABIStableToAdd | APIBreakingToRemove | ABIBreakingToRemove, 93) + DECL_ATTR(_typeEraser, TypeEraser, - OnProtocol | UserInaccessible | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove | AllowMultipleAttributes, + OnProtocol, + UserInaccessible | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove | AllowMultipleAttributes, 94) + SIMPLE_DECL_ATTR(IBSegueAction, IBSegueAction, - OnFunc | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 95) + DECL_ATTR(_originallyDefinedIn, OriginallyDefinedIn, - OnNominalType | OnFunc | OnVar | OnExtension | UserInaccessible | AllowMultipleAttributes | LongAttribute | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnNominalType | OnFunc | OnVar | OnExtension, + UserInaccessible | AllowMultipleAttributes | LongAttribute | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 96) + DECL_ATTR(derivative, Derivative, - OnFunc | LongAttribute | AllowMultipleAttributes | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, + OnFunc, + LongAttribute | AllowMultipleAttributes | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, 97) + DECL_ATTR(_spi, SPIAccessControl, - OnAbstractFunction | OnExtension | OnGenericType | OnVar | OnSubscript | OnImport | OnAccessor | OnEnumElement | OnMacro | AllowMultipleAttributes | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, + OnAbstractFunction | OnExtension | OnGenericType | OnVar | OnSubscript | OnImport | OnAccessor | OnEnumElement | OnMacro, + AllowMultipleAttributes | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, 98) + DECL_ATTR(transpose, Transpose, - OnFunc | LongAttribute | AllowMultipleAttributes | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, + OnFunc, + LongAttribute | AllowMultipleAttributes | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, 99) + SIMPLE_DECL_ATTR(noDerivative, NoDerivative, - OnAbstractFunction | OnVar | OnSubscript | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnAbstractFunction | OnVar | OnSubscript, + ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 100) + +// Unused '101' + +CONTEXTUAL_SIMPLE_DECL_ATTR(actor, Actor, + OnClass, + DeclModifier | ConcurrencyOnly | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + 102) + +CONTEXTUAL_SIMPLE_DECL_ATTR(isolated, Isolated, + OnDestructor, + DeclModifier | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + 103) + SIMPLE_DECL_ATTR(globalActor, GlobalActor, - OnClass | OnStruct | OnEnum | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, + OnClass | OnStruct | OnEnum, + ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, 104) + SIMPLE_DECL_ATTR(_specializeExtension, SpecializeExtension, - OnExtension | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnExtension, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 105) + +CONTEXTUAL_SIMPLE_DECL_ATTR(async, Async, + OnVar | OnFunc, + DeclModifier | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + 106) + SIMPLE_DECL_ATTR(Sendable, Sendable, - OnFunc | OnConstructor | OnAccessor | OnAnyClangDecl | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnFunc | OnConstructor | OnAccessor | OnAnyClangDecl, + ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 107) SIMPLE_DECL_ATTR(_marker, Marker, - OnProtocol | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnProtocol, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 108) + +SIMPLE_DECL_ATTR(reasync, Reasync, + OnFunc | OnConstructor, + RejectByParser | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + 109) + SIMPLE_DECL_ATTR(reasync, AtReasync, - OnProtocol | ConcurrencyOnly | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnProtocol, + ConcurrencyOnly | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 110) + +// Unused '111' + +CONTEXTUAL_DECL_ATTR(nonisolated, Nonisolated, + OnFunc | OnConstructor | OnDestructor | OnVar | OnSubscript | OnProtocol | OnExtension | OnClass | OnStruct | OnEnum, + DeclModifier | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, + 112) + +// Unused '113' + SIMPLE_DECL_ATTR(_unsafeInheritExecutor, UnsafeInheritExecutor, - OnFunc | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove, + OnFunc, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove, 114) + SIMPLE_DECL_ATTR(_implicitSelfCapture, ImplicitSelfCapture, - OnParam | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove, + OnParam, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove, 115) + SIMPLE_DECL_ATTR(_inheritActorContext, InheritActorContext, - OnParam | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnParam, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIBreakingToRemove, 116) + SIMPLE_DECL_ATTR(_eagerMove, EagerMove, - UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove | OnFunc | OnParam | OnVar | OnNominalType, + OnFunc | OnParam | OnVar | OnNominalType, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 117) -SIMPLE_DECL_ATTR(_lexicalLifetimes, LexicalLifetimes, - UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove | OnFunc, - 36) + +CONTEXTUAL_SIMPLE_DECL_ATTR(distributed, DistributedActor, + OnClass | OnFunc | OnAccessor | OnVar, + DeclModifier | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + 118) + SIMPLE_DECL_ATTR(_noEagerMove, NoEagerMove, - UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove | OnFunc | OnParam | OnVar | OnNominalType, + OnFunc | OnParam | OnVar | OnNominalType, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 119) + SIMPLE_DECL_ATTR(_assemblyVision, EmitAssemblyVisionRemarks, - OnFunc | UserInaccessible | NotSerialized | OnNominalType | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc | OnNominalType, + UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 120) + DECL_ATTR(_nonSendable, NonSendable, - OnNominalType | UserInaccessible | AllowMultipleAttributes | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, + OnNominalType, + UserInaccessible | AllowMultipleAttributes | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, 121) + SIMPLE_DECL_ATTR(_noImplicitCopy, NoImplicitCopy, - UserInaccessible | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove | OnFunc | OnParam | OnVar, + OnFunc | OnParam | OnVar, + UserInaccessible | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove, 122) + SIMPLE_DECL_ATTR(_noLocks, NoLocks, - OnAbstractFunction | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 123) + SIMPLE_DECL_ATTR(_noAllocation, NoAllocation, - OnAbstractFunction | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 124) + SIMPLE_DECL_ATTR(preconcurrency, Preconcurrency, - OnFunc | OnConstructor | OnProtocol | OnGenericType | OnVar | OnSubscript | OnEnumElement | OnImport | ABIStableToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnFunc | OnConstructor | OnProtocol | OnGenericType | OnVar | OnSubscript | OnEnumElement | OnImport, + ABIStableToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 125) + +CONTEXTUAL_SIMPLE_DECL_ATTR(_const, CompileTimeLiteral, + OnParam | OnVar, + DeclModifier | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, + 126) + DECL_ATTR(_unavailableFromAsync, UnavailableFromAsync, - OnFunc | OnConstructor | OnMacro | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, + OnFunc | OnConstructor | OnMacro, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, 127) + DECL_ATTR(exclusivity, Exclusivity, - OnVar | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnVar, + ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 128) + DECL_ATTR(backDeployed, BackDeployed, - OnAbstractFunction | OnAccessor | OnSubscript | OnVar | AllowMultipleAttributes | LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove, + OnAbstractFunction | OnAccessor | OnSubscript | OnVar, + AllowMultipleAttributes | LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove, 129) DECL_ATTR_ALIAS(_backDeploy, BackDeployed) + +CONTEXTUAL_SIMPLE_DECL_ATTR(_local, KnownToBeLocal, + OnFunc | OnParam | OnVar, + DeclModifier | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + 130) + SIMPLE_DECL_ATTR(_moveOnly, MoveOnly, - OnNominalType | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnNominalType, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 131) + SIMPLE_DECL_ATTR(_alwaysEmitConformanceMetadata, AlwaysEmitConformanceMetadata, - OnProtocol | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnProtocol, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 132) + DECL_ATTR(_expose, Expose, - OnFunc | OnNominalType | OnVar | AllowMultipleAttributes | OnConstructor | LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnFunc | OnNominalType | OnVar | OnConstructor, + AllowMultipleAttributes | LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 133) + +// Unused '134' + SIMPLE_DECL_ATTR(_spiOnly, SPIOnly, - OnImport | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnImport, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 135) + DECL_ATTR(_documentation, Documentation, - OnAnyDecl | UserInaccessible | APIBreakingToAdd | APIStableToRemove | ABIStableToAdd | ABIStableToRemove, + OnAnyDecl, + UserInaccessible | APIBreakingToAdd | APIStableToRemove | ABIStableToAdd | ABIStableToRemove, 136) + +// Unused '137' + SIMPLE_DECL_ATTR(_noMetadata, NoMetadata, - OnGenericTypeParam | UserInaccessible | NotSerialized | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnGenericTypeParam, + UserInaccessible | NotSerialized | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 138) + +// Unused '139' + +CONTEXTUAL_SIMPLE_DECL_ATTR(consuming, Consuming, + OnFunc | OnAccessor, + DeclModifier | NotSerialized | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + 140) + +CONTEXTUAL_SIMPLE_DECL_ATTR(borrowing, Borrowing, + OnFunc | OnAccessor, + DeclModifier | NotSerialized | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + 141) + +DECL_ATTR(attached, MacroRole, + OnMacro, + AllowMultipleAttributes | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove, + 142) +DECL_ATTR_ALIAS(freestanding, MacroRole) + SIMPLE_DECL_ATTR(_used, Used, - OnAbstractFunction | OnVar | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnAbstractFunction | OnVar, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 143) + DECL_ATTR(_section, Section, - OnAbstractFunction | OnVar | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnAbstractFunction | OnVar, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 144) + +DECL_ATTR(storageRestrictions, StorageRestrictions, + OnAccessor, + ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIBreakingToRemove, + 145) + DECL_ATTR(_rawLayout, RawLayout, - OnStruct | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnStruct, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 146) + DECL_ATTR(_extern, Extern, - OnFunc | AllowMultipleAttributes | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnFunc, + AllowMultipleAttributes | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 147) + SIMPLE_DECL_ATTR(_nonescapable, NonEscapable, - OnNominalType | UserInaccessible | ABIBreakingToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, + OnNominalType, + UserInaccessible | ABIBreakingToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, 148) + SIMPLE_DECL_ATTR(_unsafeNonescapableResult, UnsafeNonEscapableResult, - OnAbstractFunction | OnSubscript | OnAccessor | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnAbstractFunction | OnSubscript | OnAccessor, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIBreakingToRemove, 149) -CONTEXTUAL_SIMPLE_DECL_ATTR(final, Final, - OnClass | OnFunc | OnAccessor | OnVar | OnSubscript | DeclModifier | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, - 2) -CONTEXTUAL_SIMPLE_DECL_ATTR(required, Required, - OnConstructor | DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 4) -CONTEXTUAL_SIMPLE_DECL_ATTR(optional, Optional, - OnConstructor | OnFunc | OnAccessor | OnVar | OnSubscript | DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 5) -CONTEXTUAL_SIMPLE_DECL_ATTR(lazy, Lazy, - DeclModifier | OnVar | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 16) -CONTEXTUAL_SIMPLE_DECL_ATTR(dynamic, Dynamic, - OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor | DeclModifier | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, - 22) -CONTEXTUAL_SIMPLE_DECL_ATTR(infix, Infix, - OnFunc | OnOperator | DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 23) -CONTEXTUAL_SIMPLE_DECL_ATTR(prefix, Prefix, - OnFunc | OnOperator | DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 24) -CONTEXTUAL_SIMPLE_DECL_ATTR(postfix, Postfix, - OnFunc | OnOperator | DeclModifier | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 25) -CONTEXTUAL_SIMPLE_DECL_ATTR(__consuming, LegacyConsuming, - OnFunc | OnAccessor | DeclModifier | UserInaccessible | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 40) -CONTEXTUAL_SIMPLE_DECL_ATTR(mutating, Mutating, - OnFunc | OnAccessor | DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 41) -CONTEXTUAL_SIMPLE_DECL_ATTR(nonmutating, NonMutating, - OnFunc | OnAccessor | DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 42) -CONTEXTUAL_SIMPLE_DECL_ATTR(convenience, Convenience, - OnConstructor | DeclModifier | NotSerialized | ABIBreakingToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 43) -CONTEXTUAL_SIMPLE_DECL_ATTR(override, Override, - OnFunc | OnAccessor | OnVar | OnSubscript | OnConstructor | OnAssociatedType | DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 44) -DECL_ATTR(private, AccessControl, - OnFunc | OnAccessor | OnExtension | OnGenericType | OnVar | OnSubscript | OnConstructor | OnMacro | OnImport | DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 46) -DECL_ATTR_ALIAS(fileprivate, AccessControl) -DECL_ATTR_ALIAS(internal, AccessControl) -DECL_ATTR_ALIAS(public, AccessControl) -CONTEXTUAL_DECL_ATTR_ALIAS(package, AccessControl) -CONTEXTUAL_DECL_ATTR_ALIAS(open, AccessControl) -DECL_ATTR(__setter_access, SetterAccess, - OnVar | OnSubscript | DeclModifier | RejectByParser | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 47) -CONTEXTUAL_DECL_ATTR(weak, ReferenceOwnership, - OnVar | DeclModifier | NotSerialized | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, - 49) -CONTEXTUAL_DECL_ATTR_ALIAS(unowned, ReferenceOwnership) -SIMPLE_DECL_ATTR(rethrows, Rethrows, - OnFunc | OnConstructor | DeclModifier | RejectByParser | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, - 57) -CONTEXTUAL_SIMPLE_DECL_ATTR(indirect, Indirect, - DeclModifier | OnEnum | OnEnumElement | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, - 60) -CONTEXTUAL_SIMPLE_DECL_ATTR(isolated, Isolated, - DeclModifier | OnDestructor | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, - 103) -CONTEXTUAL_SIMPLE_DECL_ATTR(async, Async, - DeclModifier | OnVar | OnFunc | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, - 106) -SIMPLE_DECL_ATTR(reasync, Reasync, - OnFunc | OnConstructor | RejectByParser | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, - 109) -CONTEXTUAL_DECL_ATTR(nonisolated, Nonisolated, - DeclModifier | OnFunc | OnConstructor | OnDestructor | OnVar | OnSubscript | OnProtocol | OnExtension | OnClass | OnStruct | OnEnum | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, - 112) -CONTEXTUAL_SIMPLE_DECL_ATTR(distributed, DistributedActor, - DeclModifier | OnClass | OnFunc | OnAccessor | OnVar | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, - 118) -CONTEXTUAL_SIMPLE_DECL_ATTR(_const, CompileTimeLiteral, - DeclModifier | OnParam | OnVar | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, - 126) -CONTEXTUAL_SIMPLE_DECL_ATTR(_local, KnownToBeLocal, - DeclModifier | OnFunc | OnParam | OnVar | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, - 130) -CONTEXTUAL_SIMPLE_DECL_ATTR(consuming, Consuming, - OnFunc | OnAccessor | DeclModifier | NotSerialized | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, - 140) -CONTEXTUAL_SIMPLE_DECL_ATTR(borrowing, Borrowing, - OnFunc | OnAccessor | DeclModifier | NotSerialized | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, - 141) -DECL_ATTR(attached, MacroRole, - OnMacro | AllowMultipleAttributes | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove, - 142) -DECL_ATTR_ALIAS(freestanding, MacroRole) -DECL_ATTR(storageRestrictions, StorageRestrictions, - OnAccessor | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIBreakingToRemove, - 145) -CONTEXTUAL_SIMPLE_DECL_ATTR(actor, Actor, - DeclModifier | OnClass | ConcurrencyOnly | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, - 102) + +// Unused '150' + SIMPLE_DECL_ATTR(_staticExclusiveOnly, StaticExclusiveOnly, - OnStruct | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, + OnStruct, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, 151) + SIMPLE_DECL_ATTR(extractConstantsFromMembers, ExtractConstantsFromMembers, - OnClass | OnEnum | OnProtocol | OnStruct | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnClass | OnEnum | OnProtocol | OnStruct, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 152) + SIMPLE_DECL_ATTR(_noRuntime, NoRuntime, - OnAbstractFunction | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 153) + SIMPLE_DECL_ATTR(_noExistentials, NoExistentials, - OnAbstractFunction | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 154) + SIMPLE_DECL_ATTR(_noObjCBridging, NoObjCBridging, - OnAbstractFunction | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 155) + // Unused '156': Used to be `_distributedThunkTarget` but completed implementation in Swift 6.0 does not need it after all + DECL_ATTR(_allowFeatureSuppression, AllowFeatureSuppression, - OnAnyDecl | UserInaccessible | NotSerialized | ABIStableToAdd | APIStableToAdd | ABIStableToRemove | APIStableToRemove, + OnAnyDecl, + UserInaccessible | NotSerialized | ABIStableToAdd | APIStableToAdd | ABIStableToRemove | APIStableToRemove, 157) DECL_ATTR_ALIAS(_disallowFeatureSuppression, AllowFeatureSuppression) + SIMPLE_DECL_ATTR(_preInverseGenerics, PreInverseGenerics, - OnAbstractFunction | OnSubscript | OnVar | OnExtension | UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript | OnVar | OnExtension, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove, 158) // Declares that a struct contains "sensitive" data. It enforces that the contents of such a struct value @@ -510,45 +826,50 @@ SIMPLE_DECL_ATTR(_preInverseGenerics, PreInverseGenerics, // in memory after the value's lifetime. // TODO: enable @sensitive also for other nominal types than structs, e.g. for enums SIMPLE_DECL_ATTR(sensitive, Sensitive, - OnStruct | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, + OnStruct, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove, 159) SIMPLE_DECL_ATTR(unsafe, Unsafe, - OnAbstractFunction | OnSubscript | OnVar | OnMacro | OnNominalType | - OnExtension | OnTypeAlias | OnEnumElement | UserInaccessible | - ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript | OnVar | OnMacro | OnNominalType | OnExtension | OnTypeAlias | OnEnumElement, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 160) DECL_ATTR(lifetime, Lifetime, - OnAccessor | OnConstructor | OnFunc | OnSubscript | LongAttribute | ABIBreakingToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove | AllowMultipleAttributes, + OnAccessor | OnConstructor | OnFunc | OnSubscript, + LongAttribute | ABIBreakingToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove | AllowMultipleAttributes, 161) SIMPLE_DECL_ATTR(_addressableSelf, AddressableSelf, - OnAccessor | OnConstructor | OnFunc | OnSubscript | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove | UserInaccessible, + OnAccessor | OnConstructor | OnFunc | OnSubscript, + ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove | UserInaccessible, 162) SIMPLE_DECL_ATTR(_addressableForDependencies, AddressableForDependencies, - OnNominalType | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove | UserInaccessible, + OnNominalType, + ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove | UserInaccessible, 163) SIMPLE_DECL_ATTR(safe, Safe, - OnAbstractFunction | OnSubscript | OnVar | OnMacro | OnNominalType | - OnExtension | OnEnumElement | UserInaccessible | - ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnSubscript | OnVar | OnMacro | OnNominalType | OnExtension | OnEnumElement, + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 164) DECL_ATTR(abi, ABI, - OnAbstractFunction | OnVar /* will eventually add types */ | LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, + OnAbstractFunction | OnVar, + LongAttribute | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 165) DECL_ATTR_FEATURE_REQUIREMENT(ABI, ABIAttribute) DECL_ATTR(execution, Execution, - OnFunc | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnFunc, + ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 166) DECL_ATTR_FEATURE_REQUIREMENT(Execution, ExecutionAttribute) SIMPLE_DECL_ATTR(const, ConstVal, - OnParam | OnVar | OnFunc | ABIStableToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, + OnParam | OnVar | OnFunc, + ABIStableToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 167) DECL_ATTR_FEATURE_REQUIREMENT(ConstVal, CompileTimeValues) diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp index 7aa43bb88493c..989e7a405a159 100644 --- a/lib/AST/ASTPrinter.cpp +++ b/lib/AST/ASTPrinter.cpp @@ -1349,8 +1349,8 @@ void PrintAST::printAttributes(const Decl *D) { if (isa(D)) { #define EXCLUDE_ATTR(Class) \ Options.ExcludeAttrList.push_back(DeclAttrKind::Class); -#define CONTEXTUAL_DECL_ATTR(X, Class, Y, Z) EXCLUDE_ATTR(Class) -#define CONTEXTUAL_SIMPLE_DECL_ATTR(X, Class, Y, Z) EXCLUDE_ATTR(Class) +#define CONTEXTUAL_DECL_ATTR(X, Class, ...) EXCLUDE_ATTR(Class) +#define CONTEXTUAL_SIMPLE_DECL_ATTR(X, Class, ...) EXCLUDE_ATTR(Class) #define CONTEXTUAL_DECL_ATTR_ALIAS(X, Class) EXCLUDE_ATTR(Class) #include "swift/AST/DeclAttr.def" } diff --git a/lib/AST/Attr.cpp b/lib/AST/Attr.cpp index 6192d2be2f8c1..fc798b56f05b7 100644 --- a/lib/AST/Attr.cpp +++ b/lib/AST/Attr.cpp @@ -40,36 +40,25 @@ #include "llvm/Support/raw_ostream.h" using namespace swift; -#define DECL_ATTR(_, Id, ...) \ - static_assert(DeclAttrKind::Id <= DeclAttrKind::Last_DeclAttr); \ - static_assert(IsTriviallyDestructible::value, \ - "Attrs are BumpPtrAllocated; the destructor is never called"); -#include "swift/AST/DeclAttr.def" static_assert(IsTriviallyDestructible::value, "DeclAttributes are BumpPtrAllocated; the d'tor is never called"); -#define DECL_ATTR(Name, Id, ...) \ -static_assert(DeclAttribute::isOptionSetFor##Id(DeclAttribute::DeclAttrOptions::ABIBreakingToAdd) != \ - DeclAttribute::isOptionSetFor##Id(DeclAttribute::DeclAttrOptions::ABIStableToAdd), \ - #Name " needs to specify either ABIBreakingToAdd or ABIStableToAdd"); -#include "swift/AST/DeclAttr.def" - -#define DECL_ATTR(Name, Id, ...) \ -static_assert(DeclAttribute::isOptionSetFor##Id(DeclAttribute::DeclAttrOptions::ABIBreakingToRemove) != \ - DeclAttribute::isOptionSetFor##Id(DeclAttribute::DeclAttrOptions::ABIStableToRemove), \ - #Name " needs to specify either ABIBreakingToRemove or ABIStableToRemove"); -#include "swift/AST/DeclAttr.def" - -#define DECL_ATTR(Name, Id, ...) \ -static_assert(DeclAttribute::isOptionSetFor##Id(DeclAttribute::DeclAttrOptions::APIBreakingToAdd) != \ - DeclAttribute::isOptionSetFor##Id(DeclAttribute::DeclAttrOptions::APIStableToAdd), \ - #Name " needs to specify either APIBreakingToAdd or APIStableToAdd"); -#include "swift/AST/DeclAttr.def" - -#define DECL_ATTR(Name, Id, ...) \ -static_assert(DeclAttribute::isOptionSetFor##Id(DeclAttribute::DeclAttrOptions::APIBreakingToRemove) != \ - DeclAttribute::isOptionSetFor##Id(DeclAttribute::DeclAttrOptions::APIStableToRemove), \ - #Name " needs to specify either APIBreakingToRemove or APIStableToRemove"); +#define DECL_ATTR(Name, Id, ...) \ + static_assert(DeclAttrKind::Id <= DeclAttrKind::Last_DeclAttr); \ + static_assert(IsTriviallyDestructible::value, \ + "Attrs are BumpPtrAllocated; the destructor is never called"); \ + static_assert(DeclAttribute::hasOneBehaviorFor##Id( \ + DeclAttribute::ABIBreakingToAdd | DeclAttribute::ABIStableToAdd), \ + #Name " needs to specify either ABIBreakingToAdd or ABIStableToAdd"); \ + static_assert(DeclAttribute::hasOneBehaviorFor##Id( \ + DeclAttribute::ABIBreakingToRemove | DeclAttribute::ABIStableToRemove), \ + #Name " needs to specify either ABIBreakingToRemove or ABIStableToRemove"); \ + static_assert(DeclAttribute::hasOneBehaviorFor##Id( \ + DeclAttribute::APIBreakingToAdd | DeclAttribute::APIStableToAdd),\ + #Name " needs to specify either APIBreakingToAdd or APIStableToAdd"); \ + static_assert(DeclAttribute::hasOneBehaviorFor##Id( \ + DeclAttribute::APIBreakingToRemove | DeclAttribute::APIStableToRemove), \ + #Name " needs to specify either APIBreakingToRemove or APIStableToRemove"); #include "swift/AST/DeclAttr.def" #define TYPE_ATTR(_, Id) \ @@ -361,15 +350,15 @@ DeclAttribute *DeclAttribute::createSimple(const ASTContext &context, /// Returns true if this attribute can appear on the specified decl. bool DeclAttribute::canAttributeAppearOnDecl(DeclAttrKind DK, const Decl *D) { - if ((getOptions(DK) & OnAnyClangDecl) && D->hasClangNode()) + if ((getRequirements(DK) & OnAnyClangDecl) && D->hasClangNode()) return true; return canAttributeAppearOnDeclKind(DK, D->getKind()); } bool DeclAttribute::canAttributeAppearOnDeclKind(DeclAttrKind DAK, DeclKind DK) { - auto Options = getOptions(DAK); + auto Reqs = getRequirements(DAK); switch (DK) { -#define DECL(Id, Parent) case DeclKind::Id: return (Options & On##Id) != 0; +#define DECL(Id, Parent) case DeclKind::Id: return (Reqs & On##Id) != 0; #include "swift/AST/DeclNodes.def" } llvm_unreachable("bad DeclKind"); @@ -1713,11 +1702,21 @@ void DeclAttribute::print(llvm::raw_ostream &OS, const Decl *D) const { print(P, PrintOptions(), D); } -uint64_t DeclAttribute::getOptions(DeclAttrKind DK) { +uint64_t DeclAttribute::getRequirements(DeclAttrKind DK) { + switch (DK) { +#define DECL_ATTR(_, CLASS, REQUIREMENTS, BEHAVIORS, ...) \ + case DeclAttrKind::CLASS: \ + return REQUIREMENTS; +#include "swift/AST/DeclAttr.def" + } + llvm_unreachable("bad DeclAttrKind"); +} + +uint64_t DeclAttribute::getBehaviors(DeclAttrKind DK) { switch (DK) { -#define DECL_ATTR(_, CLASS, OPTIONS, ...) \ +#define DECL_ATTR(_, CLASS, REQUIREMENTS, BEHAVIORS, ...) \ case DeclAttrKind::CLASS: \ - return OPTIONS; + return BEHAVIORS; #include "swift/AST/DeclAttr.def" } llvm_unreachable("bad DeclAttrKind"); diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 534f70d9fd5dd..6b858dd86554e 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2656,7 +2656,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes, } // If this is a SIL-only attribute, reject it. - if ((DeclAttribute::getOptions(DK) & DeclAttribute::SILOnly) != 0 && + if ((DeclAttribute::getBehaviors(DK) & DeclAttribute::SILOnly) != 0 && !isInSILMode()) { diagnose(Loc, diag::only_allowed_in_sil, AttrName); DiscardAttribute = true; diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index f4fedb4c69ac2..c9ae50dcfd1d9 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -2005,7 +2005,7 @@ void TypeChecker::checkDeclAttributes(Decl *D) { // Otherwise, this attribute cannot be applied to this declaration. If the // attribute is only valid on one kind of declaration (which is pretty // common) give a specific helpful error. - auto PossibleDeclKinds = attr->getOptions() & DeclAttribute::OnAnyDecl; + auto PossibleDeclKinds = attr->getRequirements() & DeclAttribute::OnAnyDecl; StringRef OnlyKind; switch (PossibleDeclKinds) { case DeclAttribute::OnAccessor: OnlyKind = "accessor"; break; diff --git a/lib/Serialization/DeclTypeRecordNodes.def b/lib/Serialization/DeclTypeRecordNodes.def index 52da3c69b6c8a..c62a94b8b41b9 100644 --- a/lib/Serialization/DeclTypeRecordNodes.def +++ b/lib/Serialization/DeclTypeRecordNodes.def @@ -221,7 +221,7 @@ OTHER(LIFETIME_DEPENDENCE, 160) TRAILING_INFO(INHERITED_PROTOCOLS) #ifndef DECL_ATTR -#define DECL_ATTR(NAME, CLASS, OPTIONS, CODE) RECORD_VAL(CLASS##_DECL_ATTR, 180+CODE) +#define DECL_ATTR(NAME, CLASS, REQS, BEHAVIORS, CODE) RECORD_VAL(CLASS##_DECL_ATTR, 180+CODE) #endif #include "swift/AST/DeclAttr.def" diff --git a/lib/SymbolGraphGen/SymbolGraph.cpp b/lib/SymbolGraphGen/SymbolGraph.cpp index 9cef132c9a383..bc22d5296d6dc 100644 --- a/lib/SymbolGraphGen/SymbolGraph.cpp +++ b/lib/SymbolGraphGen/SymbolGraph.cpp @@ -141,7 +141,7 @@ SymbolGraph::getSubHeadingDeclarationFragmentsPrintOptions() const { Options.PrintOverrideKeyword = false; Options.PrintGenericRequirements = false; -#define DECL_ATTR(SPELLING, CLASS, OPTIONS, CODE) \ +#define DECL_ATTR(SPELLING, CLASS, ...) \ Options.ExcludeAttrList.push_back(DeclAttrKind::CLASS); #define TYPE_ATTR(X, C) Options.ExcludeAttrList.push_back(TypeAttrKind::C); #include "swift/AST/DeclAttr.def"