Remove Maybe type; Enum names

This commit is contained in:
Ginger Bill
2017-02-10 14:59:18 +00:00
parent 454d0b5cf5
commit f18ae89931
15 changed files with 344 additions and 473 deletions
-21
View File
@@ -172,13 +172,6 @@ void ir_print_type(irFileBuffer *f, irModule *m, Type *t) {
ir_print_type(f, m, t->Pointer.elem);
ir_fprintf(f, "*");
return;
case Type_Maybe:
ir_fprintf(f, "{");
ir_print_type(f, m, t->Maybe.elem);
ir_fprintf(f, ", ");
ir_print_type(f, m, t_bool);
ir_fprintf(f, "}");
return;
case Type_Array:
ir_fprintf(f, "[%lld x ", t->Array.count);
ir_print_type(f, m, t->Array.elem);
@@ -306,25 +299,11 @@ void ir_print_compound_element(irFileBuffer *f, irModule *m, ExactValue v, Type
ir_print_type(f, m, elem_type);
ir_fprintf(f, " ");
if (v.kind != ExactValue_Invalid && is_type_maybe(elem_type)) {
Type *t = base_type(elem_type)->Maybe.elem;
ir_fprintf(f, "{");
ir_print_type(f, m, t);
ir_fprintf(f, " ");
}
if (v.kind == ExactValue_Invalid || base_type(elem_type) == t_any) {
ir_fprintf(f, "zeroinitializer");
} else {
ir_print_exact_value(f, m, v, elem_type);
}
if (v.kind != ExactValue_Invalid && is_type_maybe(elem_type)) {
ir_fprintf(f, ", ");
ir_print_type(f, m, t_bool);
ir_fprintf(f, " ");
ir_fprintf(f, "true}");
}
}
void ir_print_exact_value(irFileBuffer *f, irModule *m, ExactValue value, Type *type) {