aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2019-05-06 11:41:15 -0500
committerShawn Landden <shawn@git.icu>2019-05-06 11:52:47 -0500
commitc19bdc2d370f3a72ef492e2f4e6264e2a0dd91ec (patch)
tree26c14f9b6b1b0edaee401842a7fe3af34a462ee8 /src/ir_print.cpp
parent7a41af2632e693cd63476576bbbb965126e45b9b (diff)
downloadzig-c19bdc2d370f3a72ef492e2f4e6264e2a0dd91ec.tar.gz
zig-c19bdc2d370f3a72ef492e2f4e6264e2a0dd91ec.zip
stage1: add @hasField() built-in
This was quite straight-forward Closes: #1439
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index dba0e4ee00..683bf0dd86 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -1107,6 +1107,14 @@ static void ir_print_type_info(IrPrint *irp, IrInstructionTypeInfo *instruction)
fprintf(irp->f, ")");
}
+static void ir_print_has_field(IrPrint *irp, IrInstructionHasField *instruction) {
+ fprintf(irp->f, "@hasField(");
+ ir_print_other_instruction(irp, instruction->container_type);
+ fprintf(irp->f, ",");
+ ir_print_other_instruction(irp, instruction->field_name_expr);
+ fprintf(irp->f, ")");
+}
+
static void ir_print_type_id(IrPrint *irp, IrInstructionTypeId *instruction) {
fprintf(irp->f, "@typeId(");
ir_print_other_instruction(irp, instruction->type_value);
@@ -1757,6 +1765,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdTypeInfo:
ir_print_type_info(irp, (IrInstructionTypeInfo *)instruction);
break;
+ case IrInstructionIdHasField:
+ ir_print_has_field(irp, (IrInstructionHasField *)instruction);
+ break;
case IrInstructionIdTypeId:
ir_print_type_id(irp, (IrInstructionTypeId *)instruction);
break;