Get the value type constraint for an SSA value operand, where `ctrl_typevar` is the controlling type variable. Each operand constraint is represented as a string, one of: - `Concrete(vt)`, where `vt` is a value type name. - `Free(idx)` where `idx` is an index into `type_sets`. - `Same`, `Lane`, `AsTruthy` for controlling typevar-derived constraints.
(
operand: &'entries Operand,
ctrl_typevar: Option<&TypeVar>,
type_sets: &'table mut UniqueTable<'entries, TypeSet>,
)
| 786 | /// - `Free(idx)` where `idx` is an index into `type_sets`. |
| 787 | /// - `Same`, `Lane`, `AsTruthy` for controlling typevar-derived constraints. |
| 788 | fn get_constraint<'entries, 'table>( |
| 789 | operand: &'entries Operand, |
| 790 | ctrl_typevar: Option<&TypeVar>, |
| 791 | type_sets: &'table mut UniqueTable<'entries, TypeSet>, |
| 792 | ) -> String { |
| 793 | assert!(operand.is_value()); |
| 794 | let type_var = operand.type_var().unwrap(); |
| 795 | |
| 796 | if let Some(typ) = type_var.singleton_type() { |
| 797 | return format!("Concrete({})", typ.rust_name()); |
| 798 | } |
| 799 | |
| 800 | if let Some(free_typevar) = type_var.free_typevar() { |
| 801 | if ctrl_typevar.is_some() && free_typevar != *ctrl_typevar.unwrap() { |
| 802 | assert!(type_var.base.is_none()); |
| 803 | return format!("Free({})", type_sets.add(type_var.get_raw_typeset())); |
| 804 | } |
| 805 | } |
| 806 | |
| 807 | if let Some(base) = &type_var.base { |
| 808 | assert!(base.type_var == *ctrl_typevar.unwrap()); |
| 809 | return camel_case(base.derived_func.name()); |
| 810 | } |
| 811 | |
| 812 | assert!(type_var == ctrl_typevar.unwrap()); |
| 813 | "Same".into() |
| 814 | } |
| 815 | |
| 816 | fn gen_bitset<'a, T: IntoIterator<Item = &'a u16>>( |
| 817 | iterable: T, |
no test coverage detected