Skip to content

Drop the TopLevelContext from the high-level type checker entrypoints #28246

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
Nov 14, 2019

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Nov 13, 2019

TopLevelContext's only use was as an entropy service for top-level autoclosure discriminator generation. It's really not important where we get this information from, so just put it on the ASTContext so we don't have to hand around these parameters when calling the high-level type checking entrypoints.

There was one caller that needed some extra handling: REPLChecker. I'm not ashamed of stealing the discriminator scrobbler from DebuggerTransform to satisfy that dependency. This codepath can take the hit of the small performance degradation this will cause for extremely large, many-file, closure-filled REPL inputs.

Ultimately, this makes it easier to stick in a high-level request for type checking an entire file so we can start working on online request-based dependencies.

This bit has historically survived typechecking and parsing across source files.  Stick it where we stick the other global state.

This also means we don't have to thread TopLevelContext around anymore when invoking high-level typechecking entrypoints.
It's really not important where it manages to find this unique value, but it's gotta get it from somewhere.  Shameless steal DiscriminatorFinder from DebuggerTransform to scrobble for the next available discriminator value.
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 13, 2019

@swift-ci please smoke test

Whoops, can't do this yet.

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 13, 2019

swiftlang/llvm-project#303

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 09c7c74

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 14, 2019

swiftlang/llvm-project#303

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 14, 2019

⛵️

@CodaFi CodaFi merged commit 3975e72 into swiftlang:master Nov 14, 2019
@CodaFi CodaFi deleted the contextual-equivalence branch November 14, 2019 03:59
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Nov 18, 2019
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.

2 participants