mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Macros] Add mangling for attached macro expansion.
Extend the name mangling scheme for macro expansions to cover attached macros, and use that scheme for the names of macro expansions buffers. Finishes rdar://104038303, stabilizing file/buffer names for macro expansion buffers.
This commit is contained in:
@@ -340,6 +340,7 @@ private:
|
||||
|
||||
case Node::Kind::PackExpansion:
|
||||
case Node::Kind::ProtocolListWithClass:
|
||||
case Node::Kind::AccessorAttachedMacroExpansion:
|
||||
case Node::Kind::AccessorFunctionReference:
|
||||
case Node::Kind::Allocator:
|
||||
case Node::Kind::ArgumentTuple:
|
||||
@@ -442,6 +443,8 @@ private:
|
||||
case Node::Kind::Macro:
|
||||
case Node::Kind::MacroExpansionUniqueName:
|
||||
case Node::Kind::MaterializeForSet:
|
||||
case Node::Kind::MemberAttributeAttachedMacroExpansion:
|
||||
case Node::Kind::MemberAttachedMacroExpansion:
|
||||
case Node::Kind::MergedFunction:
|
||||
case Node::Kind::Metaclass:
|
||||
case Node::Kind::MethodDescriptor:
|
||||
@@ -1338,10 +1341,22 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth,
|
||||
Node->getNumChildren() == 3? TypePrinting::WithColon
|
||||
: TypePrinting::FunctionStyle,
|
||||
/*hasName*/ true);
|
||||
case Node::Kind::AccessorAttachedMacroExpansion:
|
||||
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,
|
||||
/*hasName*/true, "accessor macro expansion #",
|
||||
(int)Node->getChild(2)->getIndex() + 1);
|
||||
case Node::Kind::FreestandingMacroExpansion:
|
||||
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,
|
||||
/*hasName*/true, "freestanding macro expansion #",
|
||||
(int)Node->getChild(2)->getIndex() + 1);
|
||||
case Node::Kind::MemberAttributeAttachedMacroExpansion:
|
||||
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,
|
||||
/*hasName*/true, "member attribute macro expansion #",
|
||||
(int)Node->getChild(2)->getIndex() + 1);
|
||||
case Node::Kind::MemberAttachedMacroExpansion:
|
||||
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,
|
||||
/*hasName*/true, "member macro expansion #",
|
||||
(int)Node->getChild(2)->getIndex() + 1);
|
||||
case Node::Kind::MacroExpansionUniqueName:
|
||||
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,
|
||||
/*hasName*/true, "unique name #",
|
||||
|
||||
Reference in New Issue
Block a user