Merge pull request #32161 from hamishknight/pipeline-parse

This commit is contained in:
Hamish Knight
2020-06-08 10:56:28 -07:00
committed by GitHub
20 changed files with 251 additions and 185 deletions

View File

@@ -912,15 +912,17 @@ SourceFile *CompilerInstance::createSourceFileForMainModule(
opts |= SourceFile::ParsingFlags::SuppressWarnings;
}
SourceFile *inputFile = new (*Context)
SourceFile(*mainModule, fileKind, bufferID,
Invocation.getLangOptions().CollectParsedToken,
Invocation.getLangOptions().BuildSyntaxTree, opts, isPrimary);
// Enable interface hash computation for primaries, but not in WMO, as it's
// only currently needed for incremental mode.
if (isPrimary) {
opts |= SourceFile::ParsingFlags::EnableInterfaceHash;
}
opts |= SourceFile::getDefaultParsingOptions(getASTContext().LangOpts);
auto *inputFile = new (*Context)
SourceFile(*mainModule, fileKind, bufferID, opts, isPrimary);
MainModule->addFile(*inputFile);
if (isPrimary) {
inputFile->enableInterfaceHash();
}
return inputFile;
}