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

Method ctrl_typevar

cranelift/codegen/src/ir/dfg.rs:1214–1235  ·  view source on GitHub ↗

Get the controlling type variable, or `INVALID` if `inst` isn't polymorphic.

(&self, inst: Inst)

Source from the content-addressed store, hash-verified

1212
1213 /// Get the controlling type variable, or `INVALID` if `inst` isn't polymorphic.
1214 pub fn ctrl_typevar(&self, inst: Inst) -> Type {
1215 let constraints = self.insts[inst].opcode().constraints();
1216
1217 if !constraints.is_polymorphic() {
1218 types::INVALID
1219 } else if constraints.requires_typevar_operand() {
1220 // Not all instruction formats have a designated operand, but in that case
1221 // `requires_typevar_operand()` should never be true.
1222 self.value_type(
1223 self.insts[inst]
1224 .typevar_operand(&self.value_lists)
1225 .unwrap_or_else(|| {
1226 panic!(
1227 "Instruction format for {:?} doesn't have a designated operand",
1228 self.insts[inst]
1229 )
1230 }),
1231 )
1232 } else {
1233 self.value_type(self.first_result(inst))
1234 }
1235 }
1236}
1237
1238/// basic blocks.

Callers 13

controlling_typeMethod · 0.80
inline_oneFunction · 0.80
type_suffixFunction · 0.80
write_operandsFunction · 0.80
clone_instMethod · 0.80
fmtMethod · 0.80
get_inst_keyMethod · 0.80
insert_pure_enodeMethod · 0.80
verify_bitcastMethod · 0.80
verify_constant_sizeMethod · 0.80
typecheckMethod · 0.80

Calls 7

constraintsMethod · 0.80
is_polymorphicMethod · 0.80
typevar_operandMethod · 0.80
first_resultMethod · 0.80
opcodeMethod · 0.45
value_typeMethod · 0.45

Tested by

no test coverage detected