aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-10-31 18:25:39 +0000
committergingerBill <bill@gingerbill.org>2019-10-31 18:25:39 +0000
commitee8d3e03f89b1f8065fc9563d84830482bc3f387 (patch)
tree756f336baf179972c4cf689c9c61a8d9b4ff6db7 /src/ir_print.cpp
parent4aad45e3e7a500d6c86b0056ca5160c7d55ccc60 (diff)
Delay determination of procedure abi types until as late as possible to prevent type undetermination in self-referential data types #454
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 1d0c8af35..d47dfc898 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -323,12 +323,15 @@ void ir_print_proc_results(irFileBuffer *f, irModule *m, Type *t) {
void ir_print_proc_type_without_pointer(irFileBuffer *f, irModule *m, Type *t) {
+ set_procedure_abi_types(heap_allocator(), t);
+
i64 word_bits = 8*build_context.word_size;
t = base_type(t);
GB_ASSERT(is_type_proc(t));
isize param_count = t->Proc.param_count;
isize result_count = t->Proc.result_count;
+
ir_print_proc_results(f, m, t);
ir_write_string(f, str_lit(" ("));
if (t->Proc.return_by_pointer) {
@@ -2125,6 +2128,8 @@ void ir_print_instr(irFileBuffer *f, irModule *m, irValue *value) {
void ir_print_proc(irFileBuffer *f, irModule *m, irProcedure *proc) {
+ set_procedure_abi_types(heap_allocator(), proc->type);
+
if (proc->body == nullptr) {
ir_write_str_lit(f, "declare ");
// if (proc->tags & ProcTag_dll_import) {