Skip to content

Conversation

@DougGregor
Copy link
Member

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:

  • Bodies of implicitly-defined class deinitializers
  • Bodies of default initializers

…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.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@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());
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird indentation here

Copy link
Member Author

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!

@DougGregor DougGregor changed the title [Ty[e checker] Requestify type checking of a function body [Type checker] Requestify type checking of a function body Jul 13, 2019
@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor
Copy link
Member Author

@swift-ci please test source compatibility

@DougGregor DougGregor merged commit f97cf53 into swiftlang:master Jul 15, 2019
@DougGregor DougGregor deleted the requestify-type-check-function-body branch July 15, 2019 23:39
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