Skip to content

[NFC] Centralize TypeChecker Flags With TypeCheckerOptions #28173

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 6 commits into from
Nov 12, 2019

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Nov 9, 2019

Merge TypeCheckingFlags, TypeChecker's Options and the TypeChecker-Oriented FrontendOptions into (the one true heir) TypeCheckerOptions.

Use this to simplify a bunch of things that only needed type checkers just for this bit of state and, importantly, pull all of this out of the TypeChecker.

@davidungar Could you make sure I haven't done something terrible to frontend argument parsing?
@harlanhaskins Same, but for function body skipping?
@rintaro For the ParserUnit parts (particularly the llvm::SaveAndRestores to emulate the old behavior of passing None to the options).

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 9, 2019

swiftlang/llvm-project#240

@swift-ci please test

@harlanhaskins
Copy link
Contributor

Function body skipping stuff looks god, but why do all those tests now need import Foundation?

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 9, 2019

For some reason, we're actually emitting the "You can't use @objc without Foundation" diagnostic for these now. I suspect it's because something was calling performTypeChecking without passing the right arguments through.

@theblixguy
Copy link
Collaborator

Could we pass -disable-objc-attr-requires-foundation-module in the tests?

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 9, 2019

@theblixguy Good point. I'll push this through once the tests pass

@swift-ci
Copy link
Contributor

swift-ci commented Nov 9, 2019

Build failed
Swift Test Linux Platform
Git Sha - 3a87be79d39498648ba4069eb10fc4d99ecdf390

@CodaFi CodaFi force-pushed the gradual-typing branch 2 times, most recently from fd431dd to 9bcad43 Compare November 9, 2019 03:34
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 9, 2019

swiftlang/llvm-project#240

@swift-ci please test

@beccadax
Copy link
Contributor

beccadax commented Nov 9, 2019

Some other things we might want to move over from LangOptions:

  • DebugConstraintSolver
  • DebugConstraintSolverAttempt
  • DebugConstraintSolverOnLines
  • DebugForbidTypecheckPrefix
  • SolverMemoryThreshold
  • SolverBindingThreshold
  • SolverShrinkUnsolvedThreshold
  • SolverDisableShrink
  • DisableConstraintSolverPerformanceHacks
  • SolverEnableOperatorDesignatedTypes

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 11, 2019

swiftlang/llvm-project#240

@swift-ci please test

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 11, 2019

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 11, 2019

swiftlang/llvm-project#240

@swift-ci please smoke test

Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

Parser related changes LGTM.

De-duplicate TypeCheckingFlags, TypeChecker's Options, and the TypeChecker-Oriented FrontendOptions into a dedicated TypeCheckerOptions type.  This moves a bunch of configuration state out of the type checker and into the ASTContext where it belongs.
Strip TypeChecker of all of this state.
@CodaFi CodaFi force-pushed the gradual-typing branch 2 times, most recently from 34abe6d to 6a164ce Compare November 12, 2019 18:14
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 12, 2019

swiftlang/llvm-project#240

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 12, 2019

swiftlang/llvm-project#240

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 12, 2019

⛵️

@DougGregor DougGregor merged commit fb9bee7 into swiftlang:master Nov 12, 2019
@CodaFi CodaFi deleted the gradual-typing branch November 12, 2019 21:21
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Nov 13, 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.

7 participants