From 6f91fb4c37a676002ccb68b78bea8044ba44b7e2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 22 Dec 2016 10:39:10 -0500 Subject: IR: support const ref --- src/ir_print.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ir_print.cpp') diff --git a/src/ir_print.cpp b/src/ir_print.cpp index 7acbbb0207..c4262bf799 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -666,7 +666,8 @@ static void ir_print_array_len(IrPrint *irp, IrInstructionArrayLen *instruction) } static void ir_print_ref(IrPrint *irp, IrInstructionRef *instruction) { - fprintf(irp->f, "ref "); + const char *const_str = instruction->is_const ? "const " : ""; + fprintf(irp->f, "%sref ", const_str); ir_print_other_instruction(irp, instruction->value); } -- cgit v1.2.3