MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / from_virtual_reg_checked

Method from_virtual_reg_checked

cranelift/codegen/src/machinst/reg.rs:72–79  ·  view source on GitHub ↗

Maybe construct from a `regalloc2::VReg`, checking if the index is in-range for our bit-packing.

(vreg: regalloc2::VReg)

Source from the content-addressed store, hash-verified

70 /// Maybe construct from a `regalloc2::VReg`, checking if the
71 /// index is in-range for our bit-packing.
72 pub fn from_virtual_reg_checked(vreg: regalloc2::VReg) -> Option<Reg> {
73 let bits = vreg.bits() as u32;
74 if bits <= REG_SPILLSLOT_MASK {
75 Some(Reg(bits))
76 } else {
77 None
78 }
79 }
80
81 /// Get the physical register (`RealReg`), if this register is
82 /// one.

Callers

nothing calls this directly

Calls 2

RegClass · 0.70
bitsMethod · 0.45

Tested by

no test coverage detected