aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-05-08 17:39:00 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-05-08 17:39:00 -0400
commit0099583bd3eccbecbb827edbde46a40cf821fecf (patch)
treecb52a8242e85f3afd3343687efd79d2d1182bb97 /src/ir_print.cpp
parent50bbb34594eedf7a978c00edb525bcea472b554b (diff)
downloadzig-0099583bd3eccbecbb827edbde46a40cf821fecf.tar.gz
zig-0099583bd3eccbecbb827edbde46a40cf821fecf.zip
C pointers support .? operator
see #1967
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index dba0e4ee00..08f5cd01a4 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -1003,6 +1003,12 @@ static void ir_print_assert_zero(IrPrint *irp, IrInstructionAssertZero *instruct
fprintf(irp->f, ")");
}
+static void ir_print_assert_non_null(IrPrint *irp, IrInstructionAssertNonNull *instruction) {
+ fprintf(irp->f, "AssertNonNull(");
+ ir_print_other_instruction(irp, instruction->target);
+ fprintf(irp->f, ")");
+}
+
static void ir_print_resize_slice(IrPrint *irp, IrInstructionResizeSlice *instruction) {
fprintf(irp->f, "@resizeSlice(");
ir_print_other_instruction(irp, instruction->operand);
@@ -1880,6 +1886,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdAssertZero:
ir_print_assert_zero(irp, (IrInstructionAssertZero *)instruction);
break;
+ case IrInstructionIdAssertNonNull:
+ ir_print_assert_non_null(irp, (IrInstructionAssertNonNull *)instruction);
+ break;
case IrInstructionIdResizeSlice:
ir_print_resize_slice(irp, (IrInstructionResizeSlice *)instruction);
break;