From 4664f793dc3fed2254863a5b6efc302c095890cb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 26 Dec 2016 02:36:04 -0500 Subject: IR: pass enumToInt test --- src/ir_print.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/ir_print.cpp') diff --git a/src/ir_print.cpp b/src/ir_print.cpp index be1089f895..f0dda04c6d 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -923,11 +923,17 @@ static void ir_print_init_enum(IrPrint *irp, IrInstructionInitEnum *instruction) } static void ir_print_pointer_reinterpret(IrPrint *irp, IrInstructionPointerReinterpret *instruction) { - fprintf(irp->f, "(%s)(", buf_ptr(&instruction->base.value.type->name)); + fprintf(irp->f, "@pointerReinterpret("); ir_print_other_instruction(irp, instruction->ptr); fprintf(irp->f, ")"); } +static void ir_print_widen_or_shorten(IrPrint *irp, IrInstructionWidenOrShorten *instruction) { + fprintf(irp->f, "@widenOrShorten("); + ir_print_other_instruction(irp, instruction->target); + fprintf(irp->f, ")"); +} + static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { ir_print_prefix(irp, instruction); switch (instruction->id) { @@ -1170,6 +1176,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { case IrInstructionIdPointerReinterpret: ir_print_pointer_reinterpret(irp, (IrInstructionPointerReinterpret *)instruction); break; + case IrInstructionIdWidenOrShorten: + ir_print_widen_or_shorten(irp, (IrInstructionWidenOrShorten *)instruction); + break; } fprintf(irp->f, "\n"); } -- cgit v1.2.3