Make ConstantData a container for any-size constant values

Previously, ConstantData was a type alias for `Vec<u8>` which prevented it from having an implementation; this meant that `V128Imm` and `&[u8; 16]` were used in places that otherwise could have accepted types of different byte lengths.
This commit is contained in:
Andrew Brown
2019-09-30 14:56:03 -07:00
parent 50b7d2827d
commit 1600dba634
6 changed files with 113 additions and 36 deletions

View File

@@ -508,9 +508,8 @@ pub fn write_operands(
UnaryConst {
constant_handle, ..
} => {
let data = dfg.constants.get(constant_handle);
let v128 = V128Imm::from(&data[..]);
write!(w, " {}", v128)
let constant_data = dfg.constants.get(constant_handle);
write!(w, " {}", constant_data)
}
Shuffle { mask, args, .. } => {
let data = dfg.immediates.get(mask).expect(