Skip to content

Commit fb84412

Browse files
committed
[Serialization] Always print the name associated to an XRefError
Printing the name will help in the case of xrefs for an extension member and more. This will create errors messages like this in the case of a module with an extension not being loaded: ``` x. *** DESERIALIZATION FAILURE *** module 'SomeModule' with full misc version ... module with extension is not loaded (MyExtensionModule) Cross-reference to module 'TypesOriginalModule' ... TypeBeingExtended ``` rdar://91316948
1 parent d78d1eb commit fb84412

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ ModuleFile::resolveCrossReference(ModuleID MID, uint32_t pathLen) {
18911891
XRefExtensionPathPieceLayout::readRecord(scratch, ownerID, rawGenericSig);
18921892
M = getModule(ownerID);
18931893
if (!M) {
1894-
return llvm::make_error<XRefError>("module is not loaded",
1894+
return llvm::make_error<XRefError>("module with extension is not loaded",
18951895
pathTrace, getIdentifier(ownerID));
18961896
}
18971897
pathTrace.addExtension(M);

lib/Serialization/DeserializationErrors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class XRefError : public llvm::ErrorInfo<XRefError, DeclDeserializationError> {
282282
}
283283

284284
void log(raw_ostream &OS) const override {
285-
OS << message << "\n";
285+
OS << message << " (" << name << ")\n";
286286
path.print(OS);
287287

288288
if (!notes.empty()) {

0 commit comments

Comments
 (0)