use crate::emit::binary::Binary;
use crate::sema::ast::Type;
use inkwell::types::BasicTypeEnum;
use inkwell::values::{ArrayValue, BasicValueEnum, FunctionValue, IntValue, PointerValue};
pub(super) trait StorageSlot {
fn set_storage(
&self,
bin: &Binary,
slot: PointerValue,
dest: PointerValue,
dest_ty: BasicTypeEnum,
);
fn get_storage_address<'a>(&self, bin: &Binary<'a>, slot: PointerValue<'a>) -> ArrayValue<'a>;
fn storage_delete_single_slot(&self, bin: &Binary, slot: PointerValue);
fn storage_load_slot<'a>(
&self,
bin: &Binary<'a>,
ty: &Type,
slot: &mut IntValue<'a>,
slot_ptr: PointerValue<'a>,
function: FunctionValue,
) -> BasicValueEnum<'a>;
fn storage_store_slot<'a>(
&self,
bin: &Binary<'a>,
ty: &Type,
slot: &mut IntValue<'a>,
slot_ptr: PointerValue<'a>,
dest: BasicValueEnum<'a>,
function: FunctionValue<'a>,
);
fn storage_delete_slot<'a>(
&self,
bin: &Binary<'a>,
ty: &Type,
slot: &mut IntValue<'a>,
slot_ptr: PointerValue<'a>,
function: FunctionValue<'a>,
);
}