rust
rust copied to clipboard
Add methods to create StableMIR constant
I've been experimenting with transforming the StableMIR to instrument the code with potential UB checks.
The modified body will only be used by our analysis tool, however, constants in StableMIR must be backed by rustc constants. Thus, I'm adding a few functions to build constants, such as building string and other primitives.
One question I have is whether we should create a global allocation instead for strings.
r? @oli-obk
This PR changes Stable MIR
cc @oli-obk, @celinval, @spastorino, @ouz-a
One question I have is whether we should create a global allocation instead for strings.
what do you mean with that? First create a smir Allocation and then convert that?
My bad, I think the stable method already does that for string references. :)
@bors r+ rollup
:pushpin: Commit 893a9107b9f8b2038d77648a2ca4b06f36d3009d has been approved by oli-obk
It is now in the queue for this repository.