(&self, elts: &[Self::Value], _packed: bool)
| 188 | ) |
| 189 | } |
| 190 | fn const_struct(&self, elts: &[Self::Value], _packed: bool) -> Self::Value { |
| 191 | // Presumably this will get bitcasted to the right type? |
| 192 | // FIXME(eddyb) use `AccumulateVec`s just like `rustc` itself does. |
| 193 | let field_types = elts.iter().map(|f| f.ty).collect::<Vec<_>>(); |
| 194 | let (field_offsets, size, align) = crate::abi::auto_struct_layout(self, &field_types); |
| 195 | let struct_ty = SpirvType::Adt { |
| 196 | def_id: None, |
| 197 | size, |
| 198 | align, |
| 199 | field_types: &field_types, |
| 200 | field_offsets: &field_offsets, |
| 201 | field_names: None, |
| 202 | } |
| 203 | .def(DUMMY_SP, self); |
| 204 | self.constant_composite(struct_ty, elts.iter().map(|f| f.def_cx(self))) |
| 205 | } |
| 206 | |
| 207 | fn const_to_opt_uint(&self, v: Self::Value) -> Option<u64> { |
| 208 | self.builder.lookup_const_u64(v) |
nothing calls this directly
no test coverage detected