forked from M-Labs/nac3
1
0
Fork 0

core: Use size_t for accessing array elements

This commit is contained in:
David Mak 2024-03-07 12:59:48 +08:00
parent cccd8f2d00
commit ebf86cd134
1 changed files with 2 additions and 3 deletions

View File

@ -592,7 +592,6 @@ fn call_ndarray_eye_impl<'ctx>(
ncols: IntValue<'ctx>, ncols: IntValue<'ctx>,
offset: IntValue<'ctx>, offset: IntValue<'ctx>,
) -> Result<NDArrayValue<'ctx>, String> { ) -> Result<NDArrayValue<'ctx>, String> {
let llvm_i32 = ctx.ctx.i32_type();
let llvm_usize = generator.get_size_type(ctx.ctx); let llvm_usize = generator.get_size_type(ctx.ctx);
let llvm_usize_2 = llvm_usize.array_type(2); let llvm_usize_2 = llvm_usize.array_type(2);
@ -623,12 +622,12 @@ fn call_ndarray_eye_impl<'ctx>(
|generator, ctx, indices| { |generator, ctx, indices| {
let row = ctx.build_gep_and_load( let row = ctx.build_gep_and_load(
indices, indices,
&[llvm_i32.const_zero()], &[llvm_usize.const_int(0, false)],
None, None,
).into_int_value(); ).into_int_value();
let col = ctx.build_gep_and_load( let col = ctx.build_gep_and_load(
indices, indices,
&[llvm_i32.const_int(1, true)], &[llvm_usize.const_int(1, false)],
None, None,
).into_int_value(); ).into_int_value();