Skip to content

[AST] Remove ModuleDecl::addFile #77666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Nov 16, 2024

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.

@hamishknight hamishknight force-pushed the lets-try-this-again branch 2 times, most recently from 7cadaf9 to 67ba133 Compare November 17, 2024 13:14
@hamishknight hamishknight changed the title [DNM] [AST] Remove ModuleDecl::addFile [AST] Remove ModuleDecl::addFile Nov 17, 2024
This resolves imports for the entire module.
We shouldn't be attempting to append SourceFiles
to the module after-the-fact for syntactic macro
expansion, refactor things such that the SourceFile
is created alongside the ModuleDecl.
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.
@hamishknight
Copy link
Contributor Author

swiftlang/llvm-project#9618

@swift-ci please test

@hamishknight
Copy link
Contributor Author

swiftlang/llvm-project#9618

@swift-ci please test source compatibility

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup, no notes

@hamishknight
Copy link
Contributor Author

swiftlang/llvm-project#9618

@swift-ci please test

@hamishknight hamishknight merged commit 23e3f5f into swiftlang:main Nov 21, 2024
7 checks passed
@hamishknight hamishknight deleted the lets-try-this-again branch November 21, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants