Skip to content

Commit 12019c5

Browse files
committed
Frontend: Describe all reasons a module could not be loaded.
The `unable to load compiled module` diagnostic could be incomplete because `invalidModuleReason()` did not have a description for every serialization status code. Resolves rdar://115664927
1 parent 841f015 commit 12019c5

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,34 @@ struct ModuleRebuildInfo {
310310
return "compiled with an older version of the compiler";
311311
case Status::FormatTooNew:
312312
return "compiled with a newer version of the compiler";
313+
case Status::RevisionIncompatible:
314+
return "compiled with a different version of the compiler";
315+
case Status::NotInOSSA:
316+
return "module was not built with OSSA";
317+
case Status::MissingDependency:
318+
return "missing dependency";
319+
case Status::MissingUnderlyingModule:
320+
return "missing underlying module";
321+
case Status::CircularDependency:
322+
return "circular dependency";
323+
case Status::FailedToLoadBridgingHeader:
324+
return "failed to load bridging header";
313325
case Status::Malformed:
314326
return "malformed";
327+
case Status::MalformedDocumentation:
328+
return "malformed documentation";
329+
case Status::NameMismatch:
330+
return "name mismatch";
315331
case Status::TargetIncompatible:
316332
return "compiled for a different target platform";
317333
case Status::TargetTooNew:
318334
return "target platform newer than current platform";
319-
default: return nullptr;
335+
case Status::SDKMismatch:
336+
return "SDK does not match";
337+
case Status::Valid:
338+
return nullptr;
320339
}
340+
llvm_unreachable("bad status");
321341
}
322342

323343
/// Emits a diagnostic for all out-of-date compiled or forwarding modules

0 commit comments

Comments
 (0)