Add intrinsics.map_cell_info and intrinsics.map_info

This commit is contained in:
gingerBill
2022-11-08 12:24:00 +00:00
parent ed58374964
commit a74093784c
7 changed files with 40 additions and 23 deletions
+5 -5
View File
@@ -501,10 +501,10 @@ lbValue lb_generate_anonymous_proc_lit(lbModule *m, String const &prefix_name, A
}
LLVMValueRef lb_gen_map_cell_info(lbModule *m, Type *type) {
lbValue lb_gen_map_cell_info_ptr(lbModule *m, Type *type) {
lbAddr *found = map_get(&m->map_cell_info_map, type);
if (found) {
return found->addr.value;
return found->addr;
}
i64 size = 0, len = 0;
@@ -523,7 +523,7 @@ LLVMValueRef lb_gen_map_cell_info(lbModule *m, Type *type) {
map_set(&m->map_cell_info_map, type, addr);
return addr.addr.value;
return addr.addr;
}
lbValue lb_gen_map_info_ptr(lbModule *m, Type *map_type) {
map_type = base_type(map_type);
@@ -537,8 +537,8 @@ lbValue lb_gen_map_info_ptr(lbModule *m, Type *map_type) {
GB_ASSERT(t_map_info != nullptr);
GB_ASSERT(t_map_cell_info != nullptr);
LLVMValueRef key_cell_info = lb_gen_map_cell_info(m, map_type->Map.key);
LLVMValueRef value_cell_info = lb_gen_map_cell_info(m, map_type->Map.value);
LLVMValueRef key_cell_info = lb_gen_map_cell_info_ptr(m, map_type->Map.key).value;
LLVMValueRef value_cell_info = lb_gen_map_cell_info_ptr(m, map_type->Map.value).value;
LLVMValueRef const_values[4] = {};
const_values[0] = key_cell_info;