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

@ -29,14 +29,11 @@ pub(crate) fn decode_from_utf8_result<'a, 'ctx, 'env>(
match env.target_info.ptr_width() {
PtrWidth::Bytes4 | PtrWidth::Bytes8 => {
let result_ptr_cast = env
.builder
.build_bitcast(
pointer,
record_type.ptr_type(AddressSpace::Generic),
"to_unnamed",
)
.into_pointer_value();
let result_ptr_cast = env.builder.build_pointer_cast(
pointer,
record_type.ptr_type(AddressSpace::Generic),
"to_unnamed",
);
builder
.build_load(result_ptr_cast, "load_utf8_validate_bytes_result")