aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-11-19 01:56:48 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-11-19 01:56:48 -0500
commit6c8b919d17fd456671710087c199bfd7d5a13c38 (patch)
tree29e209672853ddbb62b01b3485aabc3f98a55e8a /src/ir_print.cpp
parent2f8dd46174821a12205f939cda51f0fb4765475f (diff)
downloadzig-6c8b919d17fd456671710087c199bfd7d5a13c38.tar.gz
zig-6c8b919d17fd456671710087c199bfd7d5a13c38.zip
IR: implement ir_print for maybe type
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 1bf7776371..7ae1794a28 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -105,11 +105,19 @@ static void ir_print_const_value(IrPrint *irp, TypeTableEntry *type_entry, Const
fprintf(irp->f, "null");
break;
}
+ case TypeTableEntryIdMaybe:
+ {
+ if (const_val->data.x_maybe) {
+ ir_print_const_value(irp, type_entry->data.maybe.child_type, const_val->data.x_maybe);
+ } else {
+ fprintf(irp->f, "null");
+ }
+ break;
+ }
case TypeTableEntryIdVar:
case TypeTableEntryIdFloat:
case TypeTableEntryIdStruct:
case TypeTableEntryIdUndefLit:
- case TypeTableEntryIdMaybe:
case TypeTableEntryIdErrorUnion:
case TypeTableEntryIdPureError:
case TypeTableEntryIdEnum: