Skip to content

Commit a3b848b

Browse files
committed
[Serialization] Shorten and fix reference to wrong module in note
1 parent 4de232e commit a3b848b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,11 +1528,9 @@ ModuleFile::resolveCrossReference(ModuleID MID, uint32_t pathLen) {
15281528
// Found a full match in a different module. It should be a different
15291529
// one because otherwise it would have succeeded on the first search.
15301530
// This is usually caused by the use of poorly modularized headers.
1531-
auto line = "'" +
1531+
auto line = "There is a matching '" +
15321532
declName.getString(strScratch).str() +
1533-
"' was not found in module '" +
1534-
std::string(baseModule->getName().str()) +
1535-
"', but there is one in module '" +
1533+
"' in module '" +
15361534
std::string(nameAndModule.first.str()) +
15371535
"'. If this is imported from clang, please make sure " +
15381536
"the header is part of a single clang module.";
@@ -1545,7 +1543,7 @@ ModuleFile::resolveCrossReference(ModuleID MID, uint32_t pathLen) {
15451543
auto line = "'" +
15461544
declName.getString(strScratch).str() +
15471545
"' in module '" +
1548-
std::string(baseModule->getName().str()) +
1546+
std::string(nameAndModule.first.str()) +
15491547
"' was filtered out.";
15501548
notes.emplace_back(line);
15511549
}

test/Serialization/Recovery/crash-xref.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ public func foo() -> A.SomeType { fatalError() }
3232
// CHECK-NEXT: Caused by: top-level value not found
3333
// CHECK-NEXT: Cross-reference to 'SomeType' in module 'A'
3434
// CHECK-NEXT: Notes:
35-
// CHECK-NEXT: * 'SomeType' was not found in module 'B', but there is one in module 'B'. If this is imported from clang, please make sure the header is part of a single clang module.
35+
// CHECK-NEXT: * There is a matching 'SomeType' in module 'B'. If this is imported from clang, please make sure the header is part of a single clang module.

0 commit comments

Comments
 (0)