-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Type checker] Requestify type checking of a function body #26131
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
[Type checker] Requestify type checking of a function body #26131
Conversation
…lass. This is more a matter of principle than an optimization, eliminating unnecessary calls to `AbstractFunctionDecl::setBody()`.
When the parser wires up the body of a function, it's a legitimate use of setting a parsed body. Separate these out from the other uses of setBody() that we want to eliminate over time.
…il(). These three functions shared a bunch of code in common. Fuse them into their only caller, typeCheckAbstractFunctionBodyUntil() and centralize the point at which we set the body of the function.
… special Instead of being a completely separate body type-checking pass, refactor this function so it does the function builder transform on the body, then continues with the rest of typeCheckFunctionBodyUntil() as normal.
Extend the "type check function body" request to also cover the case where we have a specific ending source location. Fold all of this functionality into a single request, so we consistently go through a request to compute a type-checked function body.
|
@swift-ci please smoke test |
|
@swift-ci please test source compatibility |
| void dump(const SourceManager &SM) const; | ||
|
|
||
| friend size_t hash_value(SourceLoc loc) { | ||
| return reinterpret_cast<uintptr_t>(loc.getOpaquePointerValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird indentation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, tabs. I'll clean it up, thanks!
|
@swift-ci please smoke test Linux |
|
@swift-ci please test source compatibility |
More fully requestify the type checking of a function body, so it covers all uses of "type check a function body (up to a certain point)" in the request. While here, make a few more synthesized bodies lazy: