diff options
| author | gingerBill <bill@gingerbill.org> | 2020-11-23 15:53:49 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-11-23 15:53:49 +0000 |
| commit | 4e370e6ed8d6cfe3dee306dfbc298ba68722f12e (patch) | |
| tree | 075c3639d3378c47279800a97229d6ee159126ff /src/llvm_backend.cpp | |
| parent | 0b30c3dc5ad3f3908719af19e9f7e61daae37706 (diff) | |
Add `equal` procedure field to `runtime.Type_Info_Struct`
Diffstat (limited to 'src/llvm_backend.cpp')
| -rw-r--r-- | src/llvm_backend.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index a2727b012..0272d1dfa 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -12178,7 +12178,7 @@ void lb_setup_type_info_data(lbProcedure *p) { // NOTE(bill): Setup type_info da case Type_Struct: { tag = lb_const_ptr_cast(m, variant_ptr, t_type_info_struct_ptr); - LLVMValueRef vals[11] = {}; + LLVMValueRef vals[12] = {}; { @@ -12188,18 +12188,22 @@ void lb_setup_type_info_data(lbProcedure *p) { // NOTE(bill): Setup type_info da vals[5] = is_packed.value; vals[6] = is_raw_union.value; vals[7] = is_custom_align.value; + if (is_type_comparable(t) && !is_type_simple_compare(t)) { + vals[8] = lb_get_compare_proc_for_type(m, t).value; + } + if (t->Struct.soa_kind != StructSoa_None) { - lbValue kind = lb_emit_struct_ep(p, tag, 8); + lbValue kind = lb_emit_struct_ep(p, tag, 9); Type *kind_type = type_deref(kind.type); lbValue soa_kind = lb_const_value(m, kind_type, exact_value_i64(t->Struct.soa_kind)); lbValue soa_type = lb_type_info(m, t->Struct.soa_elem); lbValue soa_len = lb_const_int(m, t_int, t->Struct.soa_count); - vals[8] = soa_kind.value; - vals[9] = soa_type.value; - vals[10] = soa_len.value; + vals[9] = soa_kind.value; + vals[1] = soa_type.value; + vals[11] = soa_len.value; } } |