diff options
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp index 7ae1794a28..c65334d0d7 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -36,7 +36,8 @@ static void ir_print_const_value(IrPrint *irp, TypeTableEntry *type_entry, Const } switch (type_entry->id) { case TypeTableEntryIdInvalid: - zig_unreachable(); + fprintf(irp->f, "(invalid)"); + break; case TypeTableEntryIdVoid: fprintf(irp->f, "{}"); break; @@ -490,6 +491,12 @@ static void ir_print_compile_var(IrPrint *irp, IrInstructionCompileVar *instruct fprintf(irp->f, ")"); } +static void ir_print_size_of(IrPrint *irp, IrInstructionSizeOf *instruction) { + fprintf(irp->f, "@sizeOf("); + ir_print_other_instruction(irp, instruction->type_value); + fprintf(irp->f, ")"); +} + static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { ir_print_prefix(irp, instruction); switch (instruction->id) { @@ -582,6 +589,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { case IrInstructionIdCompileVar: ir_print_compile_var(irp, (IrInstructionCompileVar *)instruction); break; + case IrInstructionIdSizeOf: + ir_print_size_of(irp, (IrInstructionSizeOf *)instruction); + break; case IrInstructionIdSwitchBr: zig_panic("TODO print more IR instructions"); } |
