aboutsummaryrefslogtreecommitdiff
path: root/src/tilde_proc.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-07-17 23:16:50 +0100
committergingerBill <bill@gingerbill.org>2023-07-17 23:16:50 +0100
commit55733171c19aa53aebbe343d7541c3c5a1597c46 (patch)
tree896b6b8f7368b9aaa3134f0908b800598a25da2f /src/tilde_proc.cpp
parent988926b59d84aced0f5c4e5bf68d82f105f5d0da (diff)
Planning for multi-valued expressions in the tilde backend
Diffstat (limited to 'src/tilde_proc.cpp')
-rw-r--r--src/tilde_proc.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/tilde_proc.cpp b/src/tilde_proc.cpp
index 078c2ef9c..d08f611fc 100644
--- a/src/tilde_proc.cpp
+++ b/src/tilde_proc.cpp
@@ -333,7 +333,7 @@ gb_internal cgProcedure *cg_procedure_create(cgModule *m, Entity *entity, bool i
size_t out_param_count = 0;
p->debug_type = cg_debug_type_for_proc(m, p->type);
TB_Node **params = tb_function_set_prototype_from_dbg(p->func, p->debug_type, arena, &out_param_count);
- gb_unused(params);
+ p->param_nodes = {params, cast(isize)out_param_count};
p->proto = tb_function_get_prototype(p->func);
p->symbol = cast(TB_Symbol *)p->func;
@@ -387,7 +387,7 @@ gb_internal cgProcedure *cg_procedure_create_dummy(cgModule *m, String const &li
size_t out_param_count = 0;
p->debug_type = cg_debug_type_for_proc(m, p->type);
TB_Node **params = tb_function_set_prototype_from_dbg(p->func, p->debug_type, arena, &out_param_count);
- gb_unused(params);
+ p->param_nodes = {params, cast(isize)out_param_count};
p->proto = tb_function_get_prototype(p->func);
@@ -420,12 +420,11 @@ gb_internal void cg_procedure_begin(cgProcedure *p) {
continue;
}
- if (param_index >= p->proto->param_count) {
+ if (param_index >= p->param_nodes.count) {
break;
}
- // TB_Node *ptr = tb_inst_param_addr(p->func, param_index);
- TB_Node *param = tb_inst_param(p->func, param_index++);
+ TB_Node *param = p->param_nodes[param_index++];
TB_Node *ptr = tb_inst_local(p->func, cast(TB_CharUnits)type_size_of(e->type), cast(TB_CharUnits)type_align_of(e->type));
TB_DataType dt = cg_data_type(e->type);
tb_inst_store(p->func, dt, ptr, param, cast(TB_CharUnits)type_align_of(e->type), false);