aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-05-14 18:06:02 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-05-14 18:06:57 -0400
commitdf4f77024e93dc3b60dd1d76d64e3c5ffa5ebd84 (patch)
tree59d5026be2d5840255bf48b8d48a94840c26e0cf /src/ir_print.cpp
parent6536b409df053165ed704148de6ecf5b72e27282 (diff)
downloadzig-df4f77024e93dc3b60dd1d76d64e3c5ffa5ebd84.tar.gz
zig-df4f77024e93dc3b60dd1d76d64e3c5ffa5ebd84.zip
else value when switching on error set has
optional capture value which is subset. see #769
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 08f5cd01a4..992881c446 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -546,6 +546,11 @@ static void ir_print_switch_var(IrPrint *irp, IrInstructionSwitchVar *instructio
ir_print_other_instruction(irp, instruction->prong_value);
}
+static void ir_print_switch_else_var(IrPrint *irp, IrInstructionSwitchElseVar *instruction) {
+ fprintf(irp->f, "switchelsevar ");
+ ir_print_other_instruction(irp, &instruction->switch_br->base);
+}
+
static void ir_print_switch_target(IrPrint *irp, IrInstructionSwitchTarget *instruction) {
fprintf(irp->f, "switchtarget ");
ir_print_other_instruction(irp, instruction->target_value_ptr);
@@ -1559,6 +1564,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdSwitchVar:
ir_print_switch_var(irp, (IrInstructionSwitchVar *)instruction);
break;
+ case IrInstructionIdSwitchElseVar:
+ ir_print_switch_else_var(irp, (IrInstructionSwitchElseVar *)instruction);
+ break;
case IrInstructionIdSwitchTarget:
ir_print_switch_target(irp, (IrInstructionSwitchTarget *)instruction);
break;