[Frontend] Set "failed to load" for failed partial module

If a partial module fails to load, the main module
may be left without files, so let's set the failed
to load bit.
This commit is contained in:
Hamish Knight
2020-05-28 11:32:12 -07:00
parent 898f980a71
commit 21b733b4a1
2 changed files with 12 additions and 1 deletions

View File

@@ -761,8 +761,12 @@ void CompilerInstance::performSemaUpTo(SourceFile::ASTStage_t LimitStage,
// If we aren't in a parse-only context, load the remaining serialized inputs
// and resolve implicit imports.
if (LimitStage > SourceFile::Unprocessed &&
loadPartialModulesAndImplicitImports())
loadPartialModulesAndImplicitImports()) {
// If we failed to load a partial module, mark the main module as having
// "failed to load", as it may contain no files.
mainModule->setFailedToLoad();
return;
}
// Then parse all the input files.
// FIXME: This is the only demand point for InputSourceCodeBufferIDs. We