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

Method fmt

cranelift/codegen/src/machinst/reg.rs:135–149  ·  view source on GitHub ↗
(&self, f: &mut core::fmt::Formatter)

Source from the content-addressed store, hash-verified

133
134impl core::fmt::Debug for Reg {
135 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
136 if VReg::from(self.0) == VReg::invalid() {
137 write!(f, "<invalid>")
138 } else if let Some(spillslot) = self.to_spillslot() {
139 write!(f, "{spillslot}")
140 } else if let Some(rreg) = self.to_real_reg() {
141 let preg: PReg = rreg.into();
142 write!(f, "{preg}")
143 } else if let Some(vreg) = self.to_virtual_reg() {
144 let vreg: VReg = vreg.into();
145 write!(f, "{vreg}")
146 } else {
147 unreachable!()
148 }
149 }
150}
151
152impl AsMut<Reg> for Reg {

Callers

nothing calls this directly

Calls 4

fromFunction · 0.85
to_spillslotMethod · 0.80
to_real_regMethod · 0.80
to_virtual_regMethod · 0.80

Tested by

no test coverage detected