Fix IR print bug for empty structs;

This commit is contained in:
gingerBill
2017-07-28 11:35:01 +01:00
parent f0980c0a98
commit 28be0ad69b
5 changed files with 29 additions and 11 deletions
+8 -4
View File
@@ -246,10 +246,14 @@ void ir_print_type(irFileBuffer *f, irModule *m, Type *t) {
case Basic_any: ir_fprintf(f, "%%..any"); return;
}
break;
case Type_Pointer:
ir_print_type(f, m, t->Pointer.elem);
ir_fprintf(f, "*");
return;
case Type_Pointer: {
if (!is_type_named(t->Pointer.elem) && is_type_empty_struct(t->Pointer.elem)) {
ir_print_type(f, m, t_rawptr);
} else {
ir_print_type(f, m, t->Pointer.elem);
ir_fprintf(f, "*");
}
} return;
case Type_Array:
ir_fprintf(f, "[%lld x ", t->Array.count);
ir_print_type(f, m, t->Array.elem);