Skip to content

Commit 898f980

Browse files
committed
[Frontend] Set "failed to load" bit if stdlib fails
Set the "failed to load" flag on the main module if the stdlib fails to load, as we'll bail without adding any source files to the module.
1 parent 16c326e commit 898f980

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Frontend/Frontend.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,10 @@ void CompilerInstance::performSemaUpTo(SourceFile::ASTStage_t LimitStage,
744744
if (LimitStage > SourceFile::Unprocessed &&
745745
Invocation.getImplicitStdlibKind() == ImplicitStdlibKind::Stdlib
746746
&& !loadStdlib()) {
747+
// If we failed to load the stdlib, mark the main module as having
748+
// "failed to load", as it will contain no files.
749+
// FIXME: We need to better handle a missing stdlib.
750+
mainModule->setFailedToLoad();
747751
return;
748752
}
749753

0 commit comments

Comments
 (0)