[Macros] Remove the @declaration attribute.

We have @freestanding working appropriately now.
This commit is contained in:
Doug Gregor
2023-01-25 16:39:44 -08:00
parent c188ab4f91
commit af7ce9e945
19 changed files with 26 additions and 224 deletions

View File

@@ -2224,7 +2224,7 @@ static uint8_t getRawStableMacroRole(swift::MacroRole context) {
case swift::MacroRole::NAME: \
return static_cast<uint8_t>(serialization::MacroRole::NAME);
CASE(Expression)
CASE(FreestandingDeclaration)
CASE(Declaration)
CASE(Accessor)
CASE(MemberAttribute)
CASE(SynthesizedMembers)
@@ -2989,26 +2989,6 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
return;
}
case DAK_Declaration: {
auto *theAttr = cast<DeclarationAttr>(DA);
auto abbrCode = S.DeclTypeAbbrCodes[DeclarationDeclAttrLayout::Code];
auto rawMacroRole =
getRawStableMacroRole(theAttr->getMacroRole());
SmallVector<IdentifierID, 4> introducedDeclNames;
for (auto name : theAttr->getPeerAndMemberNames()) {
introducedDeclNames.push_back(IdentifierID(
getRawStableMacroIntroducedDeclNameKind(name.getKind())));
introducedDeclNames.push_back(
S.addDeclBaseNameRef(name.getIdentifier()));
}
DeclarationDeclAttrLayout::emitRecord(
S.Out, S.ScratchRecord, abbrCode, theAttr->isImplicit(),
rawMacroRole, theAttr->getPeerNames().size(),
theAttr->getMemberNames().size(), introducedDeclNames);
return;
}
case DAK_MacroRole: {
auto *theAttr = cast<MacroRoleAttr>(DA);
auto abbrCode = S.DeclTypeAbbrCodes[MacroRoleDeclAttrLayout::Code];