aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-11-23 15:53:49 +0000
committergingerBill <bill@gingerbill.org>2020-11-23 15:53:49 +0000
commit4e370e6ed8d6cfe3dee306dfbc298ba68722f12e (patch)
tree075c3639d3378c47279800a97229d6ee159126ff /src/ir.cpp
parent0b30c3dc5ad3f3908719af19e9f7e61daae37706 (diff)
Add `equal` procedure field to `runtime.Type_Info_Struct`
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index ce5dea86d..28edd5981 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -12353,8 +12353,13 @@ void ir_setup_type_info_data(irProcedure *proc) { // NOTE(bill): Setup type_info
ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 6), is_raw_union);
ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 7), is_custom_align);
+ if (is_type_comparable(t) && !is_type_simple_compare(t)) {
+ ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 8), ir_get_compare_proc_for_type(proc->module, t));
+ }
+
+
if (t->Struct.soa_kind != StructSoa_None) {
- irValue *kind = ir_emit_struct_ep(proc, tag, 8);
+ irValue *kind = ir_emit_struct_ep(proc, tag, 9);
Type *kind_type = type_deref(ir_type(kind));
irValue *soa_kind = ir_value_constant(kind_type, exact_value_i64(t->Struct.soa_kind));
@@ -12363,8 +12368,8 @@ void ir_setup_type_info_data(irProcedure *proc) { // NOTE(bill): Setup type_info
ir_emit_store(proc, kind, soa_kind);
- ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 9), soa_type);
- ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 10), soa_len);
+ ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 10), soa_type);
+ ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 11), soa_len);
}
}