Skip to content

Commit 762cf21

Browse files
authored
Merge pull request #36780 from xymus/revert-crash-path
[Serialization] Revert the change to path printing on failures
2 parents c110a42 + cd92c08 commit 762cf21

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/Serialization/DeserializationErrors.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,12 @@ class XRefTracePath {
222222
}
223223

224224
void print(raw_ostream &os, StringRef leading = "") const {
225-
os << "Cross-reference to '";
226-
interleave(path,
227-
[&](auto &piece) { piece.print(os); },
228-
[&] { os << '.'; });
229-
os << "' in module '" << baseM.getName() << "'\n";
225+
os << "Cross-reference to module '" << baseM.getName() << "'\n";
226+
for (auto &piece : path) {
227+
os << leading << "... ";
228+
piece.print(os);
229+
os << "\n";
230+
}
230231
}
231232
};
232233

test/Serialization/Recovery/crash-xref.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public func foo() -> A.SomeType { fatalError() }
3030
// CHECK: *** DESERIALIZATION FAILURE (please include this section in any bug report) ***
3131
// CHECK-NEXT: Could not deserialize type for 'foo()'
3232
// CHECK-NEXT: Caused by: top-level value not found
33-
// CHECK-NEXT: Cross-reference to 'SomeType' in module 'A'
33+
// CHECK-NEXT: Cross-reference to module 'A'
34+
// CHECK-NEXT: ... SomeType
3435
// CHECK-NEXT: Notes:
3536
// 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.

0 commit comments

Comments
 (0)