convert to pointer_cast where we can

This commit is contained in:
Folkert 2022-12-17 23:21:19 +01:00
parent 8e36456765
commit 3720c38e2b
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
9 changed files with 213 additions and 1064 deletions

View file

@ -380,14 +380,18 @@ fn build_clone<'a, 'ctx, 'env>(
let bt = basic_type_from_layout(env, &layout);
// cast the i64 pointer to a pointer to block of memory
let field1_cast = env.builder.build_bitcast(value, bt, "i64_to_opaque");
let field1_cast = env.builder.build_pointer_cast(
value.into_pointer_value(),
bt.into_pointer_type(),
"i64_to_opaque",
);
build_clone_tag(
env,
layout_ids,
ptr,
cursors,
field1_cast,
field1_cast.into(),
union_layout,
WhenRecursive::Loop(union_layout),
)