core: DO NOT MERGE - Split array values into more traits

This commit is contained in:
David Mak 2024-03-19 15:51:39 +08:00
parent faf7a0f8c0
commit aea52af1a6
1 changed files with 5 additions and 7 deletions

View File

@ -188,13 +188,6 @@ impl<'ctx> From<ArrayAllocaValue<'ctx>> for PointerValue<'ctx> {
}
impl<'ctx> ArrayLikeValue<'ctx> for ArrayAllocaValue<'ctx> {
fn cast_elem_to_type(
_: &mut CodeGenContext<'ctx, '_>,
value: BasicValueEnum<'ctx>,
) -> BasicValueEnum<'ctx> {
value
}
fn size<G: CodeGenerator + ?Sized>(
&self,
_: &mut CodeGenContext<'ctx, '_>,
@ -202,7 +195,9 @@ impl<'ctx> ArrayLikeValue<'ctx> for ArrayAllocaValue<'ctx> {
) -> IntValue<'ctx> {
self.1
}
}
impl<'ctx> ArrayLikeIndexer<'ctx> for ArrayAllocaValue<'ctx> {
unsafe fn ptr_offset_unchecked<G: CodeGenerator + ?Sized>(
&self,
ctx: &mut CodeGenContext<'ctx, '_>,
@ -247,6 +242,9 @@ impl<'ctx> ArrayLikeValue<'ctx> for ArrayAllocaValue<'ctx> {
}
}
impl<'ctx> UntypedArrayLikeAccessor<'ctx> for ArrayAllocaValue<'ctx> {}
impl<'ctx> UntypedArrayLikeMutator<'ctx> for ArrayAllocaValue<'ctx> {}
#[cfg(not(debug_assertions))]
pub fn assert_is_list<'ctx>(_value: PointerValue<'ctx>, _llvm_usize: IntType<'ctx>) {}