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

Create a MutMirVisitor #81

Open
celinval opened this issue Jun 10, 2024 · 1 comment · Fixed by rust-lang/rust#138536
Open

Create a MutMirVisitor #81

celinval opened this issue Jun 10, 2024 · 1 comment · Fixed by rust-lang/rust#138536
Assignees
Labels
good first issue Good for newcomers

Comments

@celinval
Copy link
Contributor

celinval commented Jun 10, 2024

We currently provide a MirVisitor that allows users to visit the MIR of a function body, but without mutating it. It would be super helpful to provide a new version that allows body mutation.

The mutation would only be applied to the StableMIR body. But that can be quite handy if tools want to apply some transformations before running any analysis. For example, in Kani we instrument the code with extra checks before the analysis.

@makai410
Copy link

@rustbot claim

jieyouxu added a commit to jieyouxu/rust that referenced this issue Mar 20, 2025
stable_mir: Add `MutMirVisitor`

Resolves: [rust-lang/project-stable-mir#81](rust-lang/project-stable-mir#81).

I am unsure if we should add a `MutableBody` like Kani did.
Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`.

r? `@celinval`
Kobzol added a commit to Kobzol/rust that referenced this issue Mar 21, 2025
stable_mir: Add `MutMirVisitor`

Resolves: [rust-lang/project-stable-mir#81](rust-lang/project-stable-mir#81).

I am unsure if we should add a `MutableBody` like Kani did.
Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`.

r? ``@celinval``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 21, 2025
stable_mir: Add `MutMirVisitor`

Resolves: [rust-lang/project-stable-mir#81](rust-lang/project-stable-mir#81).

I am unsure if we should add a `MutableBody` like Kani did.
Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`.

r? ```@celinval```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 21, 2025
stable_mir: Add `MutMirVisitor`

Resolves: [rust-lang/project-stable-mir#81](rust-lang/project-stable-mir#81).

I am unsure if we should add a `MutableBody` like Kani did.
Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`.

r? ````@celinval````
tgross35 added a commit to tgross35/rust that referenced this issue Mar 22, 2025
stable_mir: Add `MutMirVisitor`

Resolves: [rust-lang/project-stable-mir#81](rust-lang/project-stable-mir#81).

I am unsure if we should add a `MutableBody` like Kani did.
Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`.

r? `````@celinval`````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 22, 2025
stable_mir: Add `MutMirVisitor`

Resolves: [rust-lang/project-stable-mir#81](rust-lang/project-stable-mir#81).

I am unsure if we should add a `MutableBody` like Kani did.
Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`.

r? ``````@celinval``````
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 22, 2025
Rollup merge of rust-lang#138536 - makai410:mut-mir-visitor, r=celinval

stable_mir: Add `MutMirVisitor`

Resolves: [rust-lang/project-stable-mir#81](rust-lang/project-stable-mir#81).

I am unsure if we should add a `MutableBody` like Kani did.
Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`.

r? ``````@celinval``````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants