Skip to content

[Serialization] Revert the change to path printing on failures #36780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/Serialization/DeserializationErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,12 @@ class XRefTracePath {
}

void print(raw_ostream &os, StringRef leading = "") const {
os << "Cross-reference to '";
interleave(path,
[&](auto &piece) { piece.print(os); },
[&] { os << '.'; });
os << "' in module '" << baseM.getName() << "'\n";
os << "Cross-reference to module '" << baseM.getName() << "'\n";
for (auto &piece : path) {
os << leading << "... ";
piece.print(os);
os << "\n";
}
}
};

Expand Down
3 changes: 2 additions & 1 deletion test/Serialization/Recovery/crash-xref.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public func foo() -> A.SomeType { fatalError() }
// CHECK: *** DESERIALIZATION FAILURE (please include this section in any bug report) ***
// CHECK-NEXT: Could not deserialize type for 'foo()'
// CHECK-NEXT: Caused by: top-level value not found
// CHECK-NEXT: Cross-reference to 'SomeType' in module 'A'
// CHECK-NEXT: Cross-reference to module 'A'
// CHECK-NEXT: ... SomeType
// CHECK-NEXT: Notes:
// 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.