From 76a849b1f2c1bb57de4baf8dfd49fe9f9e2340f3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 12 Dec 2016 01:59:55 -0500 Subject: IR: implement memberCount builtin --- src/ir_print.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ir_print.cpp') diff --git a/src/ir_print.cpp b/src/ir_print.cpp index 1c62dc13fd..ede1c6461d 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -806,6 +806,12 @@ static void ir_print_slice(IrPrint *irp, IrInstructionSlice *instruction) { fprintf(irp->f, "const"); } +static void ir_print_member_count(IrPrint *irp, IrInstructionMemberCount *instruction) { + fprintf(irp->f, "@memberCount("); + ir_print_other_instruction(irp, instruction->container); + fprintf(irp->f, ")"); +} + static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { ir_print_prefix(irp, instruction); switch (instruction->id) { @@ -1000,6 +1006,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { case IrInstructionIdSlice: ir_print_slice(irp, (IrInstructionSlice *)instruction); break; + case IrInstructionIdMemberCount: + ir_print_member_count(irp, (IrInstructionMemberCount *)instruction); + break; } fprintf(irp->f, "\n"); } -- cgit v1.2.3