Skip to content

Use correct associated context for SIL parsing #31690

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 4 commits into from
May 13, 2020

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented May 10, 2020

Adjust SILModule::createEmptyModule to accept a FileUnit or ModuleDecl, and pass the corresponding context for SIL generation and parsing. This change means that SIL parsing will now correctly use a SourceFile associated context when in single-file mode.

In addition, tighten up some invariants around SILModule construction.

Now that the integrated REPL has been removed,
there is always an associated decl context, and
we can assert as such.
Rather than maintain a separate bit, check if the
associated decl context is for the ModuleDecl.
Adjust `SILModule::createEmptyModule` to accept a
FileUnit or ModuleDecl, and pass the corresponding
context for SIL generation and parsing. This
change means that SIL parsing will now correctly
use a SourceFile associated context when in
single-file mode.
@hamishknight hamishknight force-pushed the guilt-by-association branch from a472c58 to 574dd2b Compare May 11, 2020 03:36
@swiftlang swiftlang deleted a comment from swift-ci May 11, 2020
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight requested a review from gottesmm May 11, 2020 15:29
@hamishknight
Copy link
Contributor Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit f90e030 into swiftlang:master May 13, 2020
@hamishknight hamishknight deleted the guilt-by-association branch May 13, 2020 20:27
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