Skip to content

Commit 0739991

Browse files
committed
AST: New mangling for expansion locations to avoid request cycles
Fixes rdar://127078338.
1 parent 97a261e commit 0739991

13 files changed

+96
-30
lines changed

include/swift/Demangling/DemangleNodes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ NODE(LazyProtocolWitnessTableAccessor)
164164
NODE(LazyProtocolWitnessTableCacheVariable)
165165
NODE(LocalDeclName)
166166
NODE(Macro)
167+
NODE(MacroExpansionLoc)
167168
NODE(MacroExpansionUniqueName)
168169
CONTEXT_NODE(MaterializeForSet)
169170
NODE(MemberAttachedMacroExpansion)

lib/AST/ASTMangler.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4440,10 +4440,21 @@ void ASTMangler::appendMacroExpansionContext(
44404440
ASTContext &ctx = origDC->getASTContext();
44414441
SourceManager &sourceMgr = ctx.SourceMgr;
44424442

4443+
auto appendMacroExpansionLoc = [&]() {
4444+
appendIdentifier(origDC->getParentModule()->getName().str());
4445+
4446+
auto *SF = origDC->getParentSourceFile();
4447+
appendIdentifier(llvm::sys::path::filename(SF->getFilename()));
4448+
4449+
auto lineColumn = sourceMgr.getLineAndColumnInBuffer(loc);
4450+
appendOperator("fMX", Index(lineColumn.first), Index(lineColumn.second));
4451+
};
4452+
44434453
auto bufferID = sourceMgr.findBufferContainingLoc(loc);
44444454
auto generatedSourceInfo = sourceMgr.getGeneratedSourceInfo(bufferID);
4445-
if (!generatedSourceInfo)
4446-
return appendContext(origDC, nullBase, StringRef());
4455+
if (!generatedSourceInfo) {
4456+
return appendMacroExpansionLoc();
4457+
}
44474458

44484459
SourceLoc outerExpansionLoc;
44494460
DeclContext *outerExpansionDC;
@@ -4462,7 +4473,7 @@ void ASTMangler::appendMacroExpansionContext(
44624473
case GeneratedSourceInfo::PrettyPrinted:
44634474
case GeneratedSourceInfo::ReplacedFunctionBody:
44644475
case GeneratedSourceInfo::DefaultArgument:
4465-
return appendContext(origDC, nullBase, StringRef());
4476+
return appendMacroExpansionLoc();
44664477
}
44674478

44684479
switch (generatedSourceInfo->kind) {
@@ -4519,7 +4530,7 @@ void ASTMangler::appendMacroExpansionContext(
45194530
// If we hit the point where the structure is represented as a DeclContext,
45204531
// we're done.
45214532
if (origDC->isChildContextOf(outerExpansionDC))
4522-
return appendContext(origDC, nullBase, StringRef());
4533+
return appendMacroExpansionLoc();
45234534

45244535
// Append our own context and discriminator.
45254536
appendMacroExpansionContext(outerExpansionLoc, origDC);

lib/Demangling/Demangler.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4294,7 +4294,8 @@ static bool isMacroExpansionNodeKind(Node::Kind kind) {
42944294
kind == Node::Kind::MemberAttachedMacroExpansion ||
42954295
kind == Node::Kind::PeerAttachedMacroExpansion ||
42964296
kind == Node::Kind::ConformanceAttachedMacroExpansion ||
4297-
kind == Node::Kind::ExtensionAttachedMacroExpansion;
4297+
kind == Node::Kind::ExtensionAttachedMacroExpansion ||
4298+
kind == Node::Kind::MacroExpansionLoc;
42984299
}
42994300

43004301
NodePointer Demangler::demangleMacroExpansion() {
@@ -4323,6 +4324,20 @@ NodePointer Demangler::demangleMacroExpansion() {
43234324
isFreestanding = false;
43244325
break;
43254326

4327+
case 'X': {
4328+
kind = Node::Kind::MacroExpansionLoc;
4329+
4330+
int line = demangleIndex();
4331+
int col = demangleIndex();
4332+
4333+
auto lineNode = createNode(Node::Kind::Index, line);
4334+
auto colNode = createNode(Node::Kind::Index, col);
4335+
4336+
NodePointer buffer = popNode(Node::Kind::Identifier);
4337+
NodePointer module = popNode(Node::Kind::Identifier);
4338+
return createWithChildren(kind, module, buffer, lineNode, colNode);
4339+
}
4340+
43264341
default:
43274342
return nullptr;
43284343
}

lib/Demangling/NodePrinter.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ class NodePrinter {
457457
case Node::Kind::LazyProtocolWitnessTableCacheVariable:
458458
case Node::Kind::LocalDeclName:
459459
case Node::Kind::Macro:
460+
case Node::Kind::MacroExpansionLoc:
460461
case Node::Kind::MacroExpansionUniqueName:
461462
case Node::Kind::MaterializeForSet:
462463
case Node::Kind::MemberAttributeAttachedMacroExpansion:
@@ -1544,6 +1545,24 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth,
15441545
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,
15451546
/*hasName*/true, "freestanding macro expansion #",
15461547
(int)Node->getChild(2)->getIndex() + 1);
1548+
case Node::Kind::MacroExpansionLoc:
1549+
if (Node->getNumChildren() > 0) {
1550+
Printer << "module ";
1551+
print(Node->getChild(0), depth + 1);
1552+
}
1553+
if (Node->getNumChildren() > 1) {
1554+
Printer << " file ";
1555+
print(Node->getChild(1), depth + 1);
1556+
}
1557+
if (Node->getNumChildren() > 2) {
1558+
Printer << " line ";
1559+
print(Node->getChild(2), depth + 1);
1560+
}
1561+
if (Node->getNumChildren() > 3) {
1562+
Printer << " column ";
1563+
print(Node->getChild(3), depth + 1);
1564+
}
1565+
return nullptr;
15471566
case Node::Kind::MacroExpansionUniqueName:
15481567
return printEntity(Node, depth, asPrefixContext, TypePrinting::NoType,
15491568
/*hasName*/true, "unique name #",

lib/Demangling/OldRemangler.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,11 @@ ManglingError Remangler::mangleMacroExpansionUniqueName(
11151115
return mangleChildNodes(node, depth + 1);
11161116
}
11171117

1118+
ManglingError Remangler::mangleMacroExpansionLoc(
1119+
Node *node, unsigned depth) {
1120+
return MANGLING_ERROR(ManglingError::UnsupportedNodeKind, node);
1121+
}
1122+
11181123
ManglingError Remangler::mangleAccessor(Node *storageNode,
11191124
StringRef accessorCode,
11201125
EntityContext &ctx, unsigned depth) {

lib/Demangling/Remangler.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3120,6 +3120,21 @@ ManglingError Remangler::mangle##Name##AttachedMacroExpansion( \
31203120
}
31213121
#include "swift/Basic/MacroRoles.def"
31223122

3123+
ManglingError Remangler::mangleMacroExpansionLoc(
3124+
Node *node, unsigned depth) {
3125+
RETURN_IF_ERROR(mangleChildNode(node, 0, depth + 1));
3126+
RETURN_IF_ERROR(mangleChildNode(node, 1, depth + 1));
3127+
3128+
auto line = node->getChild(2)->getIndex();
3129+
auto col = node->getChild(3)->getIndex();
3130+
3131+
Buffer << "fMX";
3132+
mangleIndex(line);
3133+
mangleIndex(col);
3134+
3135+
return ManglingError::Success;
3136+
}
3137+
31233138
ManglingError Remangler::mangleMacroExpansionUniqueName(
31243139
Node *node, unsigned depth) {
31253140
RETURN_IF_ERROR(mangleChildNode(node, 0, depth + 1));

test/Macros/macro_expand.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct MemberNotCovered {
7171
// expected-note@-1 {{in expansion of macro 'NotCovered' here}}
7272

7373
// CHECK-DIAGS: error: declaration name 'value' is not covered by macro 'NotCovered'
74-
// CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser16MemberNotCoveredV33_4361AD9339943F52AE6186DD51E04E91Ll0dE0fMf_.swift
74+
// CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser0023macro_expandswift_elFCffMX69_2_33_4361AD9339943F52AE6186DD51E04E91Ll10NotCoveredfMf_.swift
7575
// CHECK-DIAGS: var value: Int
7676
// CHECK-DIAGS: END CONTENTS OF FILE
7777
}

test/Macros/macro_expand_closure.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ func multiStatementInference() -> Int {
1919

2020
// The closure intruduced by the macro expansion should not contain any inline
2121
// locations, but instead point directly into the macro buffer.
22-
// CHECK-SIL: sil_scope [[S0:[0-9]+]] { loc "@__swiftmacro_9MacroUser23multiStatementInferenceSiyF0cD0fMf_.swift":1:1 parent @$s9MacroUser23multiStatementInferenceSiyFSiyXEfU_
23-
// CHECK-SIL: sil_scope [[S2:[0-9]+]] { loc "@__swiftmacro_9MacroUser23multiStatementInferenceSiyF0cD0fMf_.swift":2:14 parent [[S0]] }
22+
// CHECK-SIL: sil_scope [[S0:[0-9]+]] { loc "@__swiftmacro_9MacroUser0031macro_expand_closureswift_yFFIifMX16_2_14multiStatementfMf_.swift":1:1 parent @$s9MacroUser23multiStatementInferenceSiyFSiyXEfU_
23+
// CHECK-SIL: sil_scope [[S2:[0-9]+]] { loc "@__swiftmacro_9MacroUser0031macro_expand_closureswift_yFFIifMX16_2_14multiStatementfMf_.swift":2:14 parent [[S0]] }
2424

2525
// CHECK-SIL: sil {{.*}} @$s9MacroUser23multiStatementInferenceSiyFSiyXEfU_
2626
// CHECK-SIL-NOT: return
27-
// CHECK-SIL: %0 = integer_literal $Builtin.Int{{64|32}}, 10, loc "@__swiftmacro_9MacroUser23multiStatementInferenceSiyF0cD0fMf_.swift":2:14, scope [[S2]]
27+
// CHECK-SIL: %0 = integer_literal $Builtin.Int{{64|32}}, 10, loc "@__swiftmacro_9MacroUser0031macro_expand_closureswift_yFFIifMX16_2_14multiStatementfMf_.swift":2:14, scope [[S2]]
2828

2929
// CHECK: 10
3030
print(multiStatementInference())

test/Macros/macro_expand_codeitems.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func testFreestandingMacroExpansion() {
2121
// CHECK: from stmt
2222
// CHECK: from usedInExpandedStmt
2323
// CHECK: from expr
24-
// CHECK-DIAGS: struct $s9MacroUser016testFreestandingA9ExpansionyyF9codeItemsfMf_3foofMu_ {
24+
// CHECK-DIAGS: struct $s9MacroUser0033macro_expand_codeitemsswift_DbGHjfMX25_2_9codeItemsfMf_3foofMu_ {
2525
// CHECK-DIAGS: END CONTENTS OF FILE
2626
#codeItems
2727

test/Macros/skip_non_exportable_decls.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
@freestanding(declaration)
1111
macro anonymousTypes(public: Bool = false, causeErrors: Bool = false, _: () -> String) = #externalMacro(module: "MacroDefinition", type: "DefineAnonymousTypesMacro")
1212

13-
// CHECK: sil @$s9MacroUser03$s9A70User33_B2D49A1BE4DC7AF5CC327EB8EE2214BDLl14anonymousTypesfMf_4namefMu_C5helloSSyF : $@convention(method) (@guaranteed $s9MacroUser33_B2D49A1BE4DC7AF5CC327EB8EE2214BDLl14anonymousTypesfMf_4namefMu_) -> @owned String {
13+
// CHECK: sil @$s9MacroUser03$s9A118User0036skip_non_exportable_declsswift_tjBBlfMX13_0_33_B2D49A1BE4DC7AF5CC327EB8EE2214BDLl14anonymousTypesfMf_4namefMu_C5helloSSyF : $@convention(method) (@guaranteed $s9MacroUser0036skip_non_exportable_declsswift_tjBBlfMX13_0_33_B2D49A1BE4DC7AF5CC327EB8EE2214BDLl14anonymousTypesfMf_4namefMu_) -> @owned String {
14+
1415
#anonymousTypes(public: true) { "hello" }
1516

16-
// CHECK-NOT: s9MacroUser03$s9A71User33_B2D49A1BE4DC7AF5CC327EB8EE2214BDLl14anonymousTypesfMf_4namefMu0_O5helloSSyF
1717
#anonymousTypes(public: false) { "goodbye" }

test/Macros/top_level_freestanding.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func lookupGlobalFreestandingExpansion() {
6060

6161
#anonymousTypes(public: true) { "hello" }
6262

63-
// CHECK-SIL: sil @$s9MacroUser03$s9A70User33_082AE7CFEFA6960C804A9FE7366EB5A0Ll14anonymousTypesfMf_4namefMu_C5helloSSyF
63+
// CHECK-SIL: sil @$s9MacroUser03$s9A115User0033top_level_freestandingswift_DbGHjfMX60_0_33_082AE7CFEFA6960C804A9FE7366EB5A0Ll14anonymousTypesfMf_4namefMu_C5helloSSyF
6464

6565
@main
6666
struct Main {
@@ -94,8 +94,8 @@ func testArbitraryAtGlobal() {
9494
}
9595
#endif
9696

97-
// DIAG_BUFFERS-DAG: @__swiftmacro_9MacroUser33_{{.*}}9stringifyfMf1_{{.*}}warning: 'deprecated()' is deprecated
98-
// DIAG_BUFFERS-DAG: @__swiftmacro_9MacroUser33_{{.*}}9stringifyfMf2_{{.*}}warning: 'deprecated()' is deprecated
97+
// DIAG_BUFFERS-DAG: @__swiftmacro_9MacroUser0039top_level_freestanding_otherswift_jrGEmfMX12_17_33_7FDB3F9D78D0279543373AD342C3C331Ll9stringifyfMf1{{.*}}: warning: 'deprecated()' is deprecated
98+
// DIAG_BUFFERS-DAG: @__swiftmacro_9MacroUser0039top_level_freestanding_otherswift_jrGEmfMX16_17_33_7FDB3F9D78D0279543373AD342C3C331Ll9stringifyfMf2{{.*}}: warning: 'deprecated()' is deprecated
9999

100100
#varValue
101101

@@ -107,8 +107,8 @@ func testGlobalVariable() {
107107

108108
// expected-note @+1 6 {{in expansion of macro 'anonymousTypes' here}}
109109
#anonymousTypes(causeErrors: true) { "foo" }
110-
// DIAG_BUFFERS-DAG: @__swiftmacro_9MacroUser33{{.*}}anonymousTypesfMf0_{{.*}}error: use of protocol 'Equatable' as a type must be written 'any Equatable'
111-
// DIAG_BUFFERS-DAG: @__swiftmacro_9MacroUser03{{.*}}anonymousTypes{{.*}}introduceTypeCheckingErrorsfMf_{{.*}}error: use of protocol 'Hashable' as a type must be written 'any Hashable'
110+
// DIAG_BUFFERS-DAG: @__swiftmacro_9MacroUser0033top_level_freestandingswift_DbGHjfMX108_0_33_082AE7CFEFA6960C804A9FE7366EB5A0Ll14anonymousTypesfMf0_{{.*}}: error: use of protocol 'Equatable' as a type must be written 'any Equatable'
111+
// DIAG_BUFFERS-DAG: @__swiftmacro_9MacroUser00142___swiftmacro_9MacroUser0033top_level_freestandingswift_DbGHjfMX108_0_33_082AE7CFEFA6960C804A9FE7366EB5A0Ll14anonymousTypesfMf0_swift_DAIABdjIbfMX23_2_33_082AE7CFEFA6960C804A9FE7366EB5A0Ll27introduceTypeCheckingErrorsfMf_{{.*}}: error: use of protocol 'Hashable' as a type must be written 'any Hashable'
112112

113113
// expected-note @+1 2 {{in expansion of macro 'anonymousTypes' here}}
114114
#anonymousTypes { () -> String in

test/SourceKit/Macros/diags.swift.response

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
key.original_location: {
66
key.offset: 1,
77
key.length: 17,
8-
key.buffer_name: "@__swiftmacro_9MacroUser3fooyyF9stringifyfMf_.swift"
8+
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_.swift"
99
},
10-
key.buffer_name: "@__swiftmacro_9MacroUser3fooyyF9stringifyfMf_11coerceToIntfMf_.swift"
10+
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_11coerceToIntfMf_.swift"
1111
},
1212
{
1313
key.buffer_text: "(#coerceToInt(\"c\"), #\"#coerceToInt(\"c\")\"#)",
@@ -16,7 +16,7 @@
1616
key.length: 29,
1717
key.buffer_name: diags.swift
1818
},
19-
key.buffer_name: "@__swiftmacro_9MacroUser3fooyyF9stringifyfMf_.swift"
19+
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_.swift"
2020
},
2121
{
2222
key.buffer_text: "\"b\" as Int",
@@ -25,7 +25,7 @@
2525
key.length: 17,
2626
key.buffer_name: diags.swift
2727
},
28-
key.buffer_name: "@__swiftmacro_9MacroUser3fooyyF11coerceToIntfMf0_.swift"
28+
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX11_10_11coerceToIntfMf0_.swift"
2929
},
3030
{
3131
key.buffer_text: "\"a\" as Int",
@@ -34,7 +34,7 @@
3434
key.length: 17,
3535
key.buffer_name: diags.swift
3636
},
37-
key.buffer_name: "@__swiftmacro_9MacroUser3fooyyF11coerceToIntfMf_.swift"
37+
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX10_10_11coerceToIntfMf_.swift"
3838
},
3939
{
4040
key.buffer_text: "import Swift\n\nprecedencegroup MyPrecedence {\n}\n\n@attached(member) macro myMacro()\n\nextension Int {\n}\n\n@main\nstruct MyMain {\n static func main() {\n }\n}\n\ntypealias Array = Void\n\ntypealias Dictionary = Void\n\ntypealias BooleanLiteralType = Void\n\ntypealias ExtendedGraphemeClusterType = Void\n\ntypealias FloatLiteralType = Void\n\ntypealias IntegerLiteralType = Void\n\ntypealias StringLiteralType = Void\n\ntypealias UnicodeScalarType = Void\n\ntypealias _ColorLiteralType = Void\n\ntypealias _ImageLiteralType = Void\n\ntypealias _FileReferenceLiteralType = Void",
@@ -59,7 +59,7 @@
5959
{
6060
key.line: 1,
6161
key.column: 1,
62-
key.filepath: "@__swiftmacro_9MacroUser3fooyyF9stringifyfMf_11coerceToIntfMf_.swift",
62+
key.filepath: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_11coerceToIntfMf_.swift",
6363
key.severity: source.diagnostic.severity.error,
6464
key.id: "cannot_convert_coerce",
6565
key.description: "cannot convert value of type 'String' to type 'Int' in coercion",
@@ -73,7 +73,7 @@
7373
{
7474
key.line: 1,
7575
key.column: 2,
76-
key.filepath: "@__swiftmacro_9MacroUser3fooyyF9stringifyfMf_.swift",
76+
key.filepath: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_.swift",
7777
key.severity: source.diagnostic.severity.note,
7878
key.id: "in_macro_expansion",
7979
key.description: "in expansion of macro 'coerceToInt' here",
@@ -103,7 +103,7 @@
103103
{
104104
key.line: 1,
105105
key.column: 1,
106-
key.filepath: "@__swiftmacro_9MacroUser3fooyyF11coerceToIntfMf0_.swift",
106+
key.filepath: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX11_10_11coerceToIntfMf0_.swift",
107107
key.severity: source.diagnostic.severity.error,
108108
key.id: "cannot_convert_coerce",
109109
key.description: "cannot convert value of type 'String' to type 'Int' in coercion",
@@ -133,7 +133,7 @@
133133
{
134134
key.line: 1,
135135
key.column: 1,
136-
key.filepath: "@__swiftmacro_9MacroUser3fooyyF11coerceToIntfMf_.swift",
136+
key.filepath: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX10_10_11coerceToIntfMf_.swift",
137137
key.severity: source.diagnostic.severity.error,
138138
key.id: "cannot_convert_coerce",
139139
key.description: "cannot convert value of type 'String' to type 'Int' in coercion",

test/SourceKit/Macros/macro_basic.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func remoteCall<Result: ConjureRemoteValue>(function: String, arguments: [String
168168
// RUN: %sourcekitd-test -req=refactoring.expand.macro -pos=4:7 %s -- ${COMPILER_ARGS[@]} | %FileCheck -check-prefix=EXPAND %s
169169
// RUN: %sourcekitd-test -req=refactoring.expand.macro -pos=4:8 %s -- ${COMPILER_ARGS[@]} | %FileCheck -check-prefix=EXPAND %s
170170
// EXPAND: source.edit.kind.active:
171-
// EXPAND-NEXT: 4:7-4:24 (@__swiftmacro_9MacroUser13testStringify1a1bySi_SitF9stringifyfMf_.swift) "(a + b, "a + b")"
171+
// EXPAND-NEXT: 4:7-4:24 (@__swiftmacro_9MacroUser0022macro_basicswift_tiAIefMX3_6_9stringifyfMf_.swift) "(a + b, "a + b")"
172172

173173
//##-- cursor-info on macro declaration
174174
// RUN: %sourcekitd-test -req=cursor -pos=57:1 -cursor-action -req-opts=retrieve_symbol_graph=1 %s -- ${COMPILER_ARGS[@]} -parse-as-library | %FileCheck -check-prefix=CURSOR_MACRO_DECL %s
@@ -193,7 +193,7 @@ func remoteCall<Result: ConjureRemoteValue>(function: String, arguments: [String
193193
// RUN: %sourcekitd-test -req=refactoring.expand.macro -pos=57:1 %s -- ${COMPILER_ARGS[@]} -parse-as-library | %FileCheck -check-prefix=EXPAND_MACRO_DECL %s
194194
// RUN: %sourcekitd-test -req=refactoring.expand.macro -pos=57:2 %s -- ${COMPILER_ARGS[@]} -parse-as-library | %FileCheck -check-prefix=EXPAND_MACRO_DECL %s
195195
// EXPAND_MACRO_DECL: source.edit.kind.active:
196-
// EXPAND_MACRO_DECL-NEXT: 57:1-57:28 (@__swiftmacro_9MacroUser33_70D4178875715FB9B8B50C58F66F8D53Ll14anonymousTypesfMf_.swift) "class $s9MacroUser33_70D4178875715FB9B8B50C58F66F8D53Ll14anonymousTypesfMf_4namefMu_ {
196+
// EXPAND_MACRO_DECL-NEXT: 57:1-57:28 (@__swiftmacro_9MacroUser0022macro_basicswift_tiAIefMX56_0_33_70D4178875715FB9B8B50C58F66F8D53Ll14anonymousTypesfMf_.swift) "class $s9MacroUser0022macro_basicswift_tiAIefMX56_0_33_70D4178875715FB9B8B50C58F66F8D53Ll14anonymousTypesfMf_4namefMu_ {
197197
// EXPAND_MACRO_DECL-NEXT: func hello() -> String {
198198
// EXPAND_MACRO_DECL-NEXT: "hello"
199199
// EXPAND_MACRO_DECL-NEXT: }
@@ -202,15 +202,15 @@ func remoteCall<Result: ConjureRemoteValue>(function: String, arguments: [String
202202
// EXPAND_MACRO_DECL-NEXT: return Self.self
203203
// EXPAND_MACRO_DECL-NEXT: }
204204
// EXPAND_MACRO_DECL-NEXT: }
205-
// EXPAND_MACRO_DECL-NEXT: enum $s9MacroUser33_70D4178875715FB9B8B50C58F66F8D53Ll14anonymousTypesfMf_4namefMu0_ {
205+
// EXPAND_MACRO_DECL-NEXT: enum $s9MacroUser0022macro_basicswift_tiAIefMX56_0_33_70D4178875715FB9B8B50C58F66F8D53Ll14anonymousTypesfMf_4namefMu0_ {
206206
// EXPAND_MACRO_DECL-NEXT: case apple
207207
// EXPAND_MACRO_DECL-NEXT: case banana
208208
// EXPAND_MACRO_DECL-EMPTY:
209209
// EXPAND_MACRO_DECL-NEXT: func hello() -> String {
210210
// EXPAND_MACRO_DECL-NEXT: "hello"
211211
// EXPAND_MACRO_DECL-NEXT: }
212212
// EXPAND_MACRO_DECL-NEXT: }
213-
// EXPAND_MACRO_DECL-NEXT: struct $s9MacroUser33_70D4178875715FB9B8B50C58F66F8D53Ll14anonymousTypesfMf_4namefMu1_: Equatable {
213+
// EXPAND_MACRO_DECL-NEXT: struct $s9MacroUser0022macro_basicswift_tiAIefMX56_0_33_70D4178875715FB9B8B50C58F66F8D53Ll14anonymousTypesfMf_4namefMu1_: Equatable {
214214
// EXPAND_MACRO_DECL-NEXT: static func == (lhs: Self, rhs: Self) -> Bool {
215215
// EXPAND_MACRO_DECL-NEXT: false
216216
// EXPAND_MACRO_DECL-NEXT: }

0 commit comments

Comments
 (0)