Generalize @attached parsing and representation to also include @freestanding.

The attached and freestanding macro attributes use the same parsing
logic and representation, so generalize the "attached" attribute into
a more general "macro role" attribute.
This commit is contained in:
Doug Gregor
2023-01-25 14:54:41 -08:00
parent f778406784
commit d74f235eb9
12 changed files with 112 additions and 60 deletions

View File

@@ -2226,10 +2226,11 @@ namespace decls_block {
BCArray<IdentifierIDField> // introduced decl name kind and identifier pairs
>;
using AttachedDeclAttrLayout = BCRecordLayout<
Attached_DECL_ATTR,
using MacroRoleDeclAttrLayout = BCRecordLayout<
MacroRole_DECL_ATTR,
BCFixed<1>, // implicit flag
MacroRoleField, // macro roles
BCFixed<1>, // macro syntax
MacroRoleField, // macro role
BCVBR<5>, // number of names
BCArray<IdentifierIDField> // introduced decl name kind and identifier pairs
>;