Use ConstantData exclusively for inserting data into the constant pool

Previously we allowed anything that could be converted into ConstantData (e.g. a Vec).
This commit is contained in:
Andrew Brown
2019-10-11 09:26:08 -07:00
parent a69b0fc221
commit 67733bd2fc
5 changed files with 30 additions and 28 deletions

View File

@@ -189,7 +189,7 @@ fn declare_locals<FE: FuncEnvironment + ?Sized>(
F32 => builder.ins().f32const(ir::immediates::Ieee32::with_bits(0)),
F64 => builder.ins().f64const(ir::immediates::Ieee64::with_bits(0)),
V128 => {
let constant_handle = builder.func.dfg.constants.insert([0; 16].to_vec());
let constant_handle = builder.func.dfg.constants.insert([0; 16].to_vec().into());
builder.ins().vconst(ir::types::I8X16, constant_handle)
}
AnyRef => builder.ins().null(environ.reference_type()),