Skip to content

Commit dd745a6

Browse files
committed
Rename mangling node for freestanding macro expansions
1 parent 7ce2b21 commit dd745a6

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

include/swift/Demangling/DemangleNodes.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ NODE(ExistentialMetatype)
9191
CONTEXT_NODE(ExplicitClosure)
9292
CONTEXT_NODE(Extension)
9393
NODE(FieldOffset)
94+
NODE(FreestandingMacroExpansion)
9495
NODE(FullTypeMetadata)
9596
CONTEXT_NODE(Function)
9697
NODE(FunctionSignatureSpecialization)
@@ -148,7 +149,6 @@ NODE(LazyProtocolWitnessTableAccessor)
148149
NODE(LazyProtocolWitnessTableCacheVariable)
149150
NODE(LocalDeclName)
150151
NODE(Macro)
151-
NODE(MacroExpansion)
152152
CONTEXT_NODE(MaterializeForSet)
153153
NODE(MergedFunction)
154154
NODE(Metatype)

lib/Demangling/Demangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3895,7 +3895,7 @@ NodePointer Demangler::demangleMacroExpansion() {
38953895
Node::Kind kind;
38963896
switch (nextChar()) {
38973897
case 'f':
3898-
kind = Node::Kind::MacroExpansion;
3898+
kind = Node::Kind::FreestandingMacroExpansion;
38993899
break;
39003900

39013901
default:

lib/Demangling/NodePrinter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ class NodePrinter {
382382
case Node::Kind::Extension:
383383
case Node::Kind::EnumCase:
384384
case Node::Kind::FieldOffset:
385+
case Node::Kind::FreestandingMacroExpansion:
385386
case Node::Kind::FullObjCResilientClassStub:
386387
case Node::Kind::FullTypeMetadata:
387388
case Node::Kind::Function:
@@ -439,7 +440,6 @@ class NodePrinter {
439440
case Node::Kind::LazyProtocolWitnessTableCacheVariable:
440441
case Node::Kind::LocalDeclName:
441442
case Node::Kind::Macro:
442-
case Node::Kind::MacroExpansion:
443443
case Node::Kind::MaterializeForSet:
444444
case Node::Kind::MergedFunction:
445445
case Node::Kind::Metaclass:
@@ -1337,9 +1337,9 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth,
13371337
Node->getNumChildren() == 3? TypePrinting::WithColon
13381338
: TypePrinting::FunctionStyle,
13391339
/*hasName*/ true);
1340-
case Node::Kind::MacroExpansion:
1340+
case Node::Kind::FreestandingMacroExpansion:
13411341
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,
1342-
/*hasName*/true, "macro expansion #",
1342+
/*hasName*/true, "freestanding macro expansion #",
13431343
(int)Node->getChild(2)->getIndex() + 1);
13441344
case Node::Kind::GenericTypeParamDecl:
13451345
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,

lib/Demangling/OldRemangler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,8 @@ ManglingError Remangler::mangleMacro(Node *node, unsigned depth) {
10631063
return mangleChildNodes(node, depth + 1);
10641064
}
10651065

1066-
ManglingError Remangler::mangleMacroExpansion(Node *node, unsigned depth) {
1066+
ManglingError Remangler::mangleFreestandingMacroExpansion(
1067+
Node *node, unsigned depth) {
10671068
Buffer << "fMf";
10681069
RETURN_IF_ERROR(mangleIndex(node, depth + 1));
10691070
return mangleChildNodes(node, depth + 1);

lib/Demangling/Remangler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2868,7 +2868,8 @@ ManglingError Remangler::mangleMacro(Node *node, unsigned depth) {
28682868
return ManglingError::Success;
28692869
}
28702870

2871-
ManglingError Remangler::mangleMacroExpansion(Node *node, unsigned depth) {
2871+
ManglingError Remangler::mangleFreestandingMacroExpansion(
2872+
Node *node, unsigned depth) {
28722873
RETURN_IF_ERROR(mangleChildNode(node, 0, depth + 1));
28732874
RETURN_IF_ERROR(mangleChildNode(node, 1, depth + 1));
28742875
Buffer << "fMf";

0 commit comments

Comments
 (0)