diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-12 01:59:55 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-12 01:59:55 -0500 |
| commit | 76a849b1f2c1bb57de4baf8dfd49fe9f9e2340f3 (patch) | |
| tree | 60b863f9ce40d7514bbdf6888a7dcd01e5c1e644 /src/ir_print.cpp | |
| parent | ef63bc9cca6370f03d76a2a19dd7cdd7e23270d4 (diff) | |
| download | zig-76a849b1f2c1bb57de4baf8dfd49fe9f9e2340f3.tar.gz zig-76a849b1f2c1bb57de4baf8dfd49fe9f9e2340f3.zip | |
IR: implement memberCount builtin
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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"); } |
