Reify generateOutputForTheWholeModule

This commit is contained in:
David Ungar
2017-09-07 14:36:05 -07:00
parent 7fe7191a54
commit 8099209ddc
2 changed files with 7 additions and 4 deletions

View File

@@ -499,7 +499,7 @@ void CompilerInstance::parseALibraryFile(
auto &Diags = NextInput->getASTContext().Diags;
auto DidSuppressWarnings = Diags.getSuppressWarnings();
auto IsPrimary =
PrimaryBufferID == NO_SUCH_BUFFER || BufferID == PrimaryBufferID;
generateOutputForTheWholeModule() || BufferID == PrimaryBufferID;
Diags.setSuppressWarnings(DidSuppressWarnings || !IsPrimary);
bool Done;
@@ -517,7 +517,7 @@ void CompilerInstance::parseALibraryFile(
OptionSet<TypeCheckingFlags> CompilerInstance::computeTypeCheckingOptions() {
OptionSet<TypeCheckingFlags> TypeCheckOptions;
if (PrimaryBufferID == NO_SUCH_BUFFER) {
if (generateOutputForTheWholeModule()) {
TypeCheckOptions |= TypeCheckingFlags::DelayWholeModuleChecking;
}
const auto &options = Invocation.getFrontendOptions();
@@ -575,7 +575,7 @@ void CompilerInstance::checkTypesWhileParsingMain(
TypeCheckOptions);
}
if (PrimaryBufferID == NO_SUCH_BUFFER)
if (generateOutputForTheWholeModule())
typeCheckEveryFileInMainModule(PersistentState, TypeCheckOptions);
else if (PrimarySourceFile != nullptr)
typeCheckThePrimaryFile(PersistentState, TypeCheckOptions);
@@ -598,7 +598,7 @@ void CompilerInstance::parseAndTypeCheckTheMainFile(
const OptionSet<TypeCheckingFlags> TypeCheckOptions) {
SharedTimer timer("performSema-checkTypesWhileParsingMain-parseAndTypeCheckTheMainFile");
bool mainIsPrimary =
(PrimaryBufferID == NO_SUCH_BUFFER || MainBufferID == PrimaryBufferID);
(generateOutputForTheWholeModule() || MainBufferID == PrimaryBufferID);
SourceFile &MainFile =
MainModule->getMainSourceFile(Invocation.getSourceFileKind());