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

Improve the treatment of abstract, polymorphic functions that are used with array types #499

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

msprotz
Copy link
Contributor

@msprotz msprotz commented Nov 22, 2024

The phase that is in charge of rewriting array-returning functions into outparam-style functions was a little bit over-zealous. Notably, in the case of a slice index operation, when the type of elements in an array already, MIR is already aware that such an operation will return a pointer, and there is no need to give is the whole "let's copy the result in an out-array" treatment.

This was the cause of a lot of pain on the Eurydice side, so fixing this properly here, with a note that this might be an instance of a more general pattern, which would avoid hardcoding something so specific.

@msprotz msprotz merged commit a88dc68 into master Nov 22, 2024
2 checks passed
@msprotz msprotz deleted the protz_poly_array branch November 22, 2024 02:59
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.

1 participant