From 5e2e77a5008420fe9576aec36844a2dc16b5743f Mon Sep 17 00:00:00 2001 From: David Mak Date: Tue, 20 Aug 2024 20:16:36 +0800 Subject: [PATCH] [meta] Bump inkwell to v0.5 --- Cargo.lock | 8 ++++---- nac3artiq/src/codegen.rs | 8 ++++---- nac3artiq/src/timeline.rs | 10 +++++----- nac3core/Cargo.toml | 2 +- nac3core/src/codegen/expr.rs | 2 +- nac3core/src/codegen/llvm_intrinsics.rs | 4 ++-- nac3core/src/codegen/numpy.rs | 8 +++++--- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e0d9f462..baf8960ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -446,9 +446,9 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "inkwell" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b597a7b2cdf279aeef6d7149071e35e4bc87c2cf05a5b7f2d731300bffe587ea" +checksum = "40fb405537710d51f6bdbc8471365ddd4cd6d3a3c3ad6e0c8291691031ba94b2" dependencies = [ "either", "inkwell_internals", @@ -460,9 +460,9 @@ dependencies = [ [[package]] name = "inkwell_internals" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fa4d8d74483041a882adaa9a29f633253a66dde85055f0495c121620ac484b2" +checksum = "9dd28cfd4cfba665d47d31c08a6ba637eed16770abca2eccbbc3ca831fef1e44" dependencies = [ "proc-macro2", "quote", diff --git a/nac3artiq/src/codegen.rs b/nac3artiq/src/codegen.rs index 1646c1c65..d16177fad 100644 --- a/nac3artiq/src/codegen.rs +++ b/nac3artiq/src/codegen.rs @@ -515,7 +515,7 @@ fn format_rpc_arg<'ctx>( ctx.builder.build_store(arg_slot, arg).unwrap(); ctx.builder - .build_bitcast(arg_slot, llvm_pi8, "rpc.arg") + .build_bit_cast(arg_slot, llvm_pi8, "rpc.arg") .map(BasicValueEnum::into_pointer_value) .unwrap() } @@ -662,7 +662,7 @@ fn format_rpc_ret<'ctx>( .unwrap(); let buffer = ctx .builder - .build_bitcast(buffer, llvm_pi8, "") + .build_bit_cast(buffer, llvm_pi8, "") .map(BasicValueEnum::into_pointer_value) .unwrap(); let buffer = ArraySliceValue::from_ptr_val(buffer, buffer_size, None); @@ -785,7 +785,7 @@ fn format_rpc_ret<'ctx>( _ => { let slot = ctx.builder.build_alloca(llvm_ret_ty, "rpc.ret.slot").unwrap(); - let slotgen = ctx.builder.build_bitcast(slot, llvm_pi8, "rpc.ret.ptr").unwrap(); + let slotgen = ctx.builder.build_bit_cast(slot, llvm_pi8, "rpc.ret.ptr").unwrap(); ctx.builder.build_unconditional_branch(head_bb).unwrap(); ctx.builder.position_at_end(head_bb); @@ -806,7 +806,7 @@ fn format_rpc_ret<'ctx>( let alloc_ptr = ctx.builder.build_array_alloca(llvm_pi8, alloc_size, "rpc.alloc").unwrap(); let alloc_ptr = - ctx.builder.build_bitcast(alloc_ptr, llvm_pi8, "rpc.alloc.ptr").unwrap(); + ctx.builder.build_bit_cast(alloc_ptr, llvm_pi8, "rpc.alloc.ptr").unwrap(); phi.add_incoming(&[(&alloc_ptr, alloc_bb)]); ctx.builder.build_unconditional_branch(head_bb).unwrap(); diff --git a/nac3artiq/src/timeline.rs b/nac3artiq/src/timeline.rs index 2f11e967b..e9faf43af 100644 --- a/nac3artiq/src/timeline.rs +++ b/nac3artiq/src/timeline.rs @@ -31,7 +31,7 @@ impl TimeFns for NowPinningTimeFns64 { .unwrap_or_else(|| ctx.module.add_global(i64_type, None, "now")); let now_hiptr = ctx .builder - .build_bitcast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") + .build_bit_cast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") .map(BasicValueEnum::into_pointer_value) .unwrap(); @@ -80,7 +80,7 @@ impl TimeFns for NowPinningTimeFns64 { .unwrap_or_else(|| ctx.module.add_global(i64_type, None, "now")); let now_hiptr = ctx .builder - .build_bitcast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") + .build_bit_cast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") .map(BasicValueEnum::into_pointer_value) .unwrap(); @@ -109,7 +109,7 @@ impl TimeFns for NowPinningTimeFns64 { .unwrap_or_else(|| ctx.module.add_global(i64_type, None, "now")); let now_hiptr = ctx .builder - .build_bitcast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") + .build_bit_cast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") .map(BasicValueEnum::into_pointer_value) .unwrap(); @@ -207,7 +207,7 @@ impl TimeFns for NowPinningTimeFns { .unwrap_or_else(|| ctx.module.add_global(i64_type, None, "now")); let now_hiptr = ctx .builder - .build_bitcast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") + .build_bit_cast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") .map(BasicValueEnum::into_pointer_value) .unwrap(); @@ -258,7 +258,7 @@ impl TimeFns for NowPinningTimeFns { let time_lo = ctx.builder.build_int_truncate(time, i32_type, "time.lo").unwrap(); let now_hiptr = ctx .builder - .build_bitcast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") + .build_bit_cast(now, i32_type.ptr_type(AddressSpace::default()), "now.hi.addr") .map(BasicValueEnum::into_pointer_value) .unwrap(); diff --git a/nac3core/Cargo.toml b/nac3core/Cargo.toml index 219c8ce9c..e669d5c7f 100644 --- a/nac3core/Cargo.toml +++ b/nac3core/Cargo.toml @@ -18,7 +18,7 @@ strum = "0.26" strum_macros = "0.26" [dependencies.inkwell] -version = "0.4" +version = "0.5" default-features = false features = ["llvm14-0-prefer-dynamic", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"] diff --git a/nac3core/src/codegen/expr.rs b/nac3core/src/codegen/expr.rs index 6fdacf15b..72b28d021 100644 --- a/nac3core/src/codegen/expr.rs +++ b/nac3core/src/codegen/expr.rs @@ -551,7 +551,7 @@ impl<'ctx, 'a> CodeGenContext<'ctx, 'a> { && val_ty.get_element_type().is_struct_type() } => { - self.builder.build_bitcast(*val, arg_ty, "call_arg_cast").unwrap() + self.builder.build_bit_cast(*val, arg_ty, "call_arg_cast").unwrap() } _ => *val, }) diff --git a/nac3core/src/codegen/llvm_intrinsics.rs b/nac3core/src/codegen/llvm_intrinsics.rs index c4a0d4300..00bdee22e 100644 --- a/nac3core/src/codegen/llvm_intrinsics.rs +++ b/nac3core/src/codegen/llvm_intrinsics.rs @@ -183,7 +183,7 @@ pub fn call_memcpy_generic<'ctx>( dest } else { ctx.builder - .build_bitcast(dest, llvm_p0i8, "") + .build_bit_cast(dest, llvm_p0i8, "") .map(BasicValueEnum::into_pointer_value) .unwrap() }; @@ -191,7 +191,7 @@ pub fn call_memcpy_generic<'ctx>( src } else { ctx.builder - .build_bitcast(src, llvm_p0i8, "") + .build_bit_cast(src, llvm_p0i8, "") .map(BasicValueEnum::into_pointer_value) .unwrap() }; diff --git a/nac3core/src/codegen/numpy.rs b/nac3core/src/codegen/numpy.rs index 41dad1f32..2463f9a0e 100644 --- a/nac3core/src/codegen/numpy.rs +++ b/nac3core/src/codegen/numpy.rs @@ -942,7 +942,7 @@ fn call_ndarray_array_impl<'ctx, G: CodeGenerator + ?Sized>( .build_store( lst, ctx.builder - .build_bitcast(object.as_base_value(), llvm_plist_i8, "") + .build_bit_cast(object.as_base_value(), llvm_plist_i8, "") .unwrap(), ) .unwrap(); @@ -964,7 +964,7 @@ fn call_ndarray_array_impl<'ctx, G: CodeGenerator + ?Sized>( .builder .build_load(lst, "") .map(BasicValueEnum::into_pointer_value) - .map(|v| ctx.builder.build_bitcast(v, plist_plist_i8, "").unwrap()) + .map(|v| ctx.builder.build_bit_cast(v, plist_plist_i8, "").unwrap()) .map(BasicValueEnum::into_pointer_value) .unwrap(); let this_dim = ListValue::from_ptr_val(this_dim, llvm_usize, None); @@ -983,7 +983,9 @@ fn call_ndarray_array_impl<'ctx, G: CodeGenerator + ?Sized>( ctx.builder .build_store( lst, - ctx.builder.build_bitcast(next_dim, llvm_plist_i8, "").unwrap(), + ctx.builder + .build_bit_cast(next_dim, llvm_plist_i8, "") + .unwrap(), ) .unwrap();