mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] Remove ModuleDecl::addFile
Rather than exposing an `addFile` member on ModuleDecl, have the `create` members take a lambda that populates the files for the module. Once module construction has finished, the files are immutable.
This commit is contained in:
@@ -94,7 +94,7 @@ struct LibParseExecutor {
|
||||
if (!opts.contains(ExecuteOptionFlag::SkipBodies))
|
||||
parseOpts |= SourceFile::ParsingFlags::DisableDelayedBodies;
|
||||
|
||||
ModuleDecl *M = ModuleDecl::create(Identifier(), *ctx);
|
||||
ModuleDecl *M = ModuleDecl::createEmpty(Identifier(), *ctx);
|
||||
SourceFile *SF =
|
||||
new (*ctx) SourceFile(*M, SourceFileKind::Library, bufferID, parseOpts);
|
||||
|
||||
@@ -170,7 +170,7 @@ struct ASTGenExecutor {
|
||||
if (!opts.contains(ExecuteOptionFlag::SkipBodies))
|
||||
parseOpts |= SourceFile::ParsingFlags::DisableDelayedBodies;
|
||||
|
||||
ModuleDecl *M = ModuleDecl::create(Identifier(), *ctx);
|
||||
ModuleDecl *M = ModuleDecl::createEmpty(Identifier(), *ctx);
|
||||
SourceFile *SF =
|
||||
new (*ctx) SourceFile(*M, SourceFileKind::Library, bufferID, parseOpts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user