You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate static handling and most of the operand codegen code to StableMIR (rust-lang#2931)
Migrate most of the operand code generation to use StableMIR APIs, and
static handling.
This change is so far the one that required some re-work, since
constants in StableMIR differ a bit from internal APIs. In the Rust
compiler internal APIs, constant values can be using either: Scalar,
Slice, Indirect (represented by an Allocation), and ZST. In the
StableAPIs, a constant value is always represented with an Allocation.
To avoid making changes to the final gotoc, we generate code for
allocations in two steps, we first try to generate just a regular
constant literal if the constant is small (similar logic to handling the
Scalar internal type).
For more complex cases, we create an allocation and read from it,
similar to how Indirect / Slice internal handling used to work.
---------
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
0 commit comments