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