diff options
| author | gingerBill <bill@gingerbill.org> | 2022-11-11 14:45:22 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-11-11 14:45:22 +0000 |
| commit | 16fc96101049ef884401ab6182ea860390abd6a9 (patch) | |
| tree | 1b4780cc59b664cc9622b174246235143dc4ecf1 /src/llvm_backend_utility.cpp | |
| parent | d2701d8b13bce7ac684c215e5ec4bd1dd65f670a (diff) | |
Begin work on map static set
Diffstat (limited to 'src/llvm_backend_utility.cpp')
| -rw-r--r-- | src/llvm_backend_utility.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp index 30c531d71..101b9dbfb 100644 --- a/src/llvm_backend_utility.cpp +++ b/src/llvm_backend_utility.cpp @@ -1438,6 +1438,13 @@ lbValue lb_map_len(lbProcedure *p, lbValue value) { lbValue len = lb_emit_struct_ev(p, value, 1); return lb_emit_conv(p, len, t_int); } +lbValue lb_map_len_ptr(lbProcedure *p, lbValue map_ptr) { + Type *type = map_ptr.type; + GB_ASSERT(is_type_pointer(type)); + type = type_deref(type); + GB_ASSERT_MSG(is_type_map(type) || are_types_identical(type, t_raw_map), "%s", type_to_string(type)); + return lb_emit_struct_ep(p, map_ptr, 1); +} lbValue lb_map_cap(lbProcedure *p, lbValue value) { GB_ASSERT_MSG(is_type_map(value.type) || are_types_identical(value.type, t_raw_map), "%s", type_to_string(value.type)); |