diff --git a/nac3core/src/codegen/types/tuple.rs b/nac3core/src/codegen/types/tuple.rs index 3facf5e..90abeb3 100644 --- a/nac3core/src/codegen/types/tuple.rs +++ b/nac3core/src/codegen/types/tuple.rs @@ -138,7 +138,7 @@ impl<'ctx> TupleType<'ctx> { let mut value = self.construct(name); for (i, val) in values.into_iter().enumerate() { - value.store_element(ctx, i as u32, val); + value.insert_element(ctx, i as u32, val); } value diff --git a/nac3core/src/codegen/values/ndarray/shape.rs b/nac3core/src/codegen/values/ndarray/shape.rs index b3331b6..69e8b50 100644 --- a/nac3core/src/codegen/values/ndarray/shape.rs +++ b/nac3core/src/codegen/values/ndarray/shape.rs @@ -106,7 +106,7 @@ pub fn parse_numpy_int_sequence<'ctx, G: CodeGenerator + ?Sized>( for i in 0..input_seq.get_type().num_elements() { // Get the i-th element off of the tuple and load it into `result`. - let int = input_seq.load_element(ctx, i).into_int_value(); + let int = input_seq.extract_element(ctx, i).into_int_value(); let int = ctx.builder.build_int_s_extend_or_bit_cast(int, llvm_usize, "").unwrap(); unsafe { diff --git a/nac3core/src/codegen/values/tuple.rs b/nac3core/src/codegen/values/tuple.rs index 320e219..1f124c8 100644 --- a/nac3core/src/codegen/values/tuple.rs +++ b/nac3core/src/codegen/values/tuple.rs @@ -45,7 +45,7 @@ impl<'ctx> TupleValue<'ctx> { } /// Stores a value into the tuple element at the given `index`. - pub fn store_element( + pub fn insert_element( &mut self, ctx: &CodeGenContext<'ctx, '_>, index: u32, @@ -63,7 +63,11 @@ impl<'ctx> TupleValue<'ctx> { } /// Loads a value from the tuple element at the given `index`. - pub fn load_element(&self, ctx: &CodeGenContext<'ctx, '_>, index: u32) -> BasicValueEnum<'ctx> { + pub fn extract_element( + &self, + ctx: &CodeGenContext<'ctx, '_>, + index: u32, + ) -> BasicValueEnum<'ctx> { ctx.builder .build_extract_value( self.value,