@@ -1448,46 +1448,19 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth,
1448
1448
Node->getNumChildren () == 3 ? TypePrinting::WithColon
1449
1449
: TypePrinting::FunctionStyle,
1450
1450
/* hasName*/ true );
1451
- case Node::Kind::AccessorAttachedMacroExpansion:
1452
- return printEntity (Node, depth, asPrefixContext, TypePrinting::NoType,
1453
- /* hasName*/ true ,
1454
- (" accessor macro @" +
1455
- nodeToString (Node->getChild (2 )) + " expansion #" ),
1451
+ #define FREESTANDING_MACRO_ROLE (Name, Description )
1452
+ #define ATTACHED_MACRO_ROLE (Name, Description, MangledChar ) \
1453
+ case Node::Kind::Name##AttachedMacroExpansion: \
1454
+ return printEntity (Node, depth, asPrefixContext, \
1455
+ TypePrinting::NoType, /* hasName*/ true , \
1456
+ (Description " macro @" + \
1457
+ nodeToString (Node->getChild (2 )) + " expansion #" ), \
1456
1458
(int )Node->getChild (3 )->getIndex () + 1 );
1459
+ #include " swift/Basic/MacroRoles.def"
1457
1460
case Node::Kind::FreestandingMacroExpansion:
1458
1461
return printEntity (Node, depth, asPrefixContext, TypePrinting::NoType,
1459
1462
/* hasName*/ true , " freestanding macro expansion #" ,
1460
1463
(int )Node->getChild (2 )->getIndex () + 1 );
1461
- case Node::Kind::MemberAttributeAttachedMacroExpansion:
1462
- return printEntity (Node, depth, asPrefixContext, TypePrinting::NoType,
1463
- /* hasName*/ true ,
1464
- (" member attribute macro @" +
1465
- nodeToString (Node->getChild (2 )) + " expansion #" ),
1466
- (int )Node->getChild (3 )->getIndex () + 1 );
1467
- case Node::Kind::MemberAttachedMacroExpansion:
1468
- return printEntity (Node, depth, asPrefixContext, TypePrinting::NoType,
1469
- /* hasName*/ true ,
1470
- (" member macro @" + nodeToString (Node->getChild (2 )) +
1471
- " expansion #" ),
1472
- (int )Node->getChild (3 )->getIndex () + 1 );
1473
- case Node::Kind::PeerAttachedMacroExpansion:
1474
- return printEntity (Node, depth, asPrefixContext, TypePrinting::NoType,
1475
- /* hasName*/ true ,
1476
- (" peer macro @" + nodeToString (Node->getChild (2 )) +
1477
- " expansion #" ),
1478
- (int )Node->getChild (3 )->getIndex () + 1 );
1479
- case Node::Kind::ConformanceAttachedMacroExpansion:
1480
- return printEntity (Node, depth, asPrefixContext, TypePrinting::NoType,
1481
- /* hasName*/ true ,
1482
- (" conformance macro @" + nodeToString (Node->getChild (2 )) +
1483
- " expansion #" ),
1484
- (int )Node->getChild (3 )->getIndex () + 1 );
1485
- case Node::Kind::ExtensionAttachedMacroExpansion:
1486
- return printEntity (Node, depth, asPrefixContext, TypePrinting::NoType,
1487
- /* hasName*/ true ,
1488
- (" extension macro @" + nodeToString (Node->getChild (2 )) +
1489
- " expansion #" ),
1490
- (int )Node->getChild (3 )->getIndex () + 1 );
1491
1464
case Node::Kind::MacroExpansionUniqueName:
1492
1465
return printEntity (Node, depth, asPrefixContext, TypePrinting::NoType,
1493
1466
/* hasName*/ true , " unique name #" ,
0 commit comments