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

[FEATURE] Types in the IR #30

Closed
LensPlaysGames opened this issue Jan 7, 2023 · 2 comments
Closed

[FEATURE] Types in the IR #30

LensPlaysGames opened this issue Jan 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@LensPlaysGames
Copy link
Owner

It seems like all we have to do is "pass through" expr->type, during codegen, into expr->ir->type. The issue of this happening everywhere is the hardest part, though, because it's currently designed in a way where expr->ir is set and then return happens immediately, but not in every case. So we could set it where codegen_expr returns, but then we may miss some instructions that were generated in between.

The other interesting thing; if an IR instruction's type can be understood from only it's arguments/children (like a call from the callee), then this means we can simply do the assigment within the creation function of the IR instruction, much like we mark uses.

So, really, we just have to figure out what the best way to actually assign expr->ir->type to expr->type within codegen_expr().

@LensPlaysGames LensPlaysGames added the enhancement New feature or request label Jan 7, 2023
@Sirraide Sirraide mentioned this issue Jan 7, 2023
@LensPlaysGames
Copy link
Owner Author

Do we want a separate IRType, with all of it's own API and everything?

Or do we just want to pass through the existing Type structures into the IR, so that they may be used by the backend?

@LensPlaysGames
Copy link
Owner Author

See #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant