Skip to content
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

Consider storing Conversion on bound conversion nodes and use at lowering. #12067

Closed
VSadov opened this issue Jun 17, 2016 · 0 comments · Fixed by #12314
Closed

Consider storing Conversion on bound conversion nodes and use at lowering. #12067

VSadov opened this issue Jun 17, 2016 · 0 comments · Fixed by #12314

Comments

@VSadov
Copy link
Member

VSadov commented Jun 17, 2016

Currently, in many cases, we classify conversions during semantic analysis and then again at lowering.

There are two issues with this:

  • classification has costs. That is possibly offset by not having to keep conversions around.
    With tuples, classification is recursive, so costs are higher. Since we keep some conversion parts anyways, why not whole conversion.
  • There is a possibility of a disconnect between analysis and lowering if different classification helpers are used (and there are many of them). Just fetching the conversion from the node would make this part less prone to errors.

There could be some concerns with the size of bound conversion node since Conversion is a relatively large struct.
That could be mitigated by shifting less used traits of Conversion into an optional reference field. It may even make sense to make the Conversion itself a reference type. Most conversions are singletons anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants