Skip to content

Make VisitType tail recursive in more cases#45328

Merged
333fred merged 2 commits intodotnet:masterfrom
333fred:visit-type-tail
Jun 23, 2020
Merged

Make VisitType tail recursive in more cases#45328
333fred merged 2 commits intodotnet:masterfrom
333fred:visit-type-tail

Conversation

@333fred
Copy link
Member

@333fred 333fred commented Jun 19, 2020

Currently, when we encounter a INamedTypeSymbol or a function pointer in VisitType, we abandon any attempt to be tail recursive and instead go for a fully recursive solution. This makes the code simple, but it does mean that we are recursive even for the simple case of a named type with one type argument, which is completely possible to handle without any recursion whatsoever. This changes our implementation to always be tail recursive for the last type argument or function pointer type.

@333fred 333fred requested a review from a team June 20, 2020 06:30
@333fred 333fred marked this pull request as ready for review June 20, 2020 06:31
@AlekseyTs
Copy link
Contributor

Done with review pass (iteration 1)

@333fred
Copy link
Member Author

333fred commented Jun 22, 2020

@AlekseyTs addressed feedback.

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (iteration 2)

@333fred 333fred merged commit 0c92f53 into dotnet:master Jun 23, 2020
@333fred 333fred deleted the visit-type-tail branch June 23, 2020 17:35
@ghost ghost added this to the Next milestone Jun 23, 2020
@dibarbet dibarbet modified the milestones: Next, 16.7.P4 Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants