mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Add a few parsing flags to SourceFile
Add flags for whether delayed body parsing or #if condition evaluation is disabled, as well as whether warnings should be suppressed. Then pass down these flags from the frontend. This is in preparation for the requestification of source file parsing where the SourceFile will need to be able to parse itself on demand.
This commit is contained in:
@@ -1896,10 +1896,11 @@ static void performAutoImport(
|
||||
SourceFile::SourceFile(ModuleDecl &M, SourceFileKind K,
|
||||
Optional<unsigned> bufferID,
|
||||
ImplicitModuleImportKind ModImpKind,
|
||||
bool KeepParsedTokens, bool BuildSyntaxTree)
|
||||
: FileUnit(FileUnitKind::Source, M),
|
||||
BufferID(bufferID ? *bufferID : -1),
|
||||
Kind(K), SyntaxInfo(new SourceFileSyntaxInfo(BuildSyntaxTree)) {
|
||||
bool KeepParsedTokens, bool BuildSyntaxTree,
|
||||
ParsingOptions parsingOpts)
|
||||
: FileUnit(FileUnitKind::Source, M), BufferID(bufferID ? *bufferID : -1),
|
||||
ParsingOpts(parsingOpts), Kind(K),
|
||||
SyntaxInfo(new SourceFileSyntaxInfo(BuildSyntaxTree)) {
|
||||
M.getASTContext().addDestructorCleanup(*this);
|
||||
performAutoImport(*this, ModImpKind);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user