diff options
| author | gingerBill <bill@gingerbill.org> | 2022-11-08 11:13:46 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-11-08 11:13:46 +0000 |
| commit | 810a1eee41cc8e047759c8934af70d6e68113082 (patch) | |
| tree | e24c9cd4ae4e63997ae5ffd636b55d923adc2e8e /src/llvm_backend_utility.cpp | |
| parent | e3e225d21b613d789ebad0273b198b5509800bf0 (diff) | |
Remove the need for `type->Map.internal_type` and replace with the definition of `runtime.Raw_Map`
Diffstat (limited to 'src/llvm_backend_utility.cpp')
| -rw-r--r-- | src/llvm_backend_utility.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp index cbe690155..f4d17c7a2 100644 --- a/src/llvm_backend_utility.cpp +++ b/src/llvm_backend_utility.cpp @@ -990,15 +990,13 @@ lbValue lb_emit_struct_ep(lbProcedure *p, lbValue s, i32 index) { } } else if (is_type_map(t)) { init_map_internal_types(t); - Type *itp = alloc_type_pointer(t->Map.internal_type); + Type *itp = alloc_type_pointer(t_raw_map); s = lb_emit_transmute(p, s, itp); - Type *gst = t->Map.internal_type; - GB_ASSERT(gst->kind == Type_Struct); switch (index) { - case 0: result_type = get_struct_field_type(gst, 0); break; - case 1: result_type = get_struct_field_type(gst, 1); break; - case 2: result_type = get_struct_field_type(gst, 2); break; + case 0: result_type = get_struct_field_type(t_raw_map, 0); break; + case 1: result_type = get_struct_field_type(t_raw_map, 1); break; + case 2: result_type = get_struct_field_type(t_raw_map, 2); break; } } else if (is_type_array(t)) { return lb_emit_array_epi(p, s, index); @@ -1131,11 +1129,10 @@ lbValue lb_emit_struct_ev(lbProcedure *p, lbValue s, i32 index) { case Type_Map: { init_map_internal_types(t); - Type *gst = t->Map.internal_type; switch (index) { - case 0: result_type = get_struct_field_type(gst, 0); break; - case 1: result_type = get_struct_field_type(gst, 1); break; - case 2: result_type = get_struct_field_type(gst, 2); break; + case 0: result_type = get_struct_field_type(t_raw_map, 0); break; + case 1: result_type = get_struct_field_type(t_raw_map, 1); break; + case 2: result_type = get_struct_field_type(t_raw_map, 2); break; } } break; |