aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-04-02 18:19:59 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-04-02 18:19:59 -0400
commit8fd0fddce5d44344dd7914ae86a4d976b99f9cc3 (patch)
tree69d6a1b6e32e8c8a622eb149c0e60f33f426996d /src/ir_print.cpp
parent0594487a2e98e18a18c0c6bdb2532c5e36fc6ea7 (diff)
downloadzig-8fd0fddce5d44344dd7914ae86a4d976b99f9cc3.tar.gz
zig-8fd0fddce5d44344dd7914ae86a4d976b99f9cc3.zip
zig build system progress
* In-progress os.ChildProcess.spawn implementation. See #204 * Add explicit cast from integer to error. Closes #294 * fix casting from error to integer * fix compiler crash when initializing variable to undefined with no type
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 7814064f85..fd912d6919 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -799,6 +799,16 @@ static void ir_print_int_to_enum(IrPrint *irp, IrInstructionIntToEnum *instructi
fprintf(irp->f, ")");
}
+static void ir_print_int_to_err(IrPrint *irp, IrInstructionIntToErr *instruction) {
+ fprintf(irp->f, "inttoerr ");
+ ir_print_other_instruction(irp, instruction->target);
+}
+
+static void ir_print_err_to_int(IrPrint *irp, IrInstructionErrToInt *instruction) {
+ fprintf(irp->f, "errtoint ");
+ ir_print_other_instruction(irp, instruction->target);
+}
+
static void ir_print_check_switch_prongs(IrPrint *irp, IrInstructionCheckSwitchProngs *instruction) {
fprintf(irp->f, "@checkSwitchProngs(");
ir_print_other_instruction(irp, instruction->target_value);
@@ -1117,6 +1127,12 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdIntToEnum:
ir_print_int_to_enum(irp, (IrInstructionIntToEnum *)instruction);
break;
+ case IrInstructionIdIntToErr:
+ ir_print_int_to_err(irp, (IrInstructionIntToErr *)instruction);
+ break;
+ case IrInstructionIdErrToInt:
+ ir_print_err_to_int(irp, (IrInstructionErrToInt *)instruction);
+ break;
case IrInstructionIdCheckSwitchProngs:
ir_print_check_switch_prongs(irp, (IrInstructionCheckSwitchProngs *)instruction);
break;