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 extraction of code manipulating arrays/slices #381

Open
sonmarcho opened this issue Dec 3, 2024 · 2 comments
Open

Improve the extraction of code manipulating arrays/slices #381

sonmarcho opened this issue Dec 3, 2024 · 2 comments

Comments

@sonmarcho
Copy link
Member

When extracting Rust code of the following shape:

a[i] = x + y;

We get:

let (_, index_mut_back) ← Array.index_mut_usize a i
let tmp ← x + y
let a1 := index_mut_back tmp

We want to get:

let tmp ← x + y
let a1 ← update a i tmp

We can easily do so through a micro-pass (there already exists one for array/slice indexing functions: we simply need to improve it).

@R1kM
Copy link
Member

R1kM commented Dec 3, 2024

Similar to #188

@sonmarcho
Copy link
Member Author

sonmarcho commented Dec 3, 2024

Ah indeed. But I'm closing this other issue because I took care of it in a recent PR. I basically need to generalize the micro-pass I implemented for it.

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

No branches or pull requests

2 participants