aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-07 11:29:44 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-07 11:29:44 -0500
commita148096e6a2d28e6248eed9b5a4ad40482b74149 (patch)
tree5a9cf9926af7b558027bbd368124e5c4069186ed /src/ir_print.cpp
parent0ad580f001eb151d0feb7ad884e237b237220800 (diff)
downloadzig-a148096e6a2d28e6248eed9b5a4ad40482b74149.tar.gz
zig-a148096e6a2d28e6248eed9b5a4ad40482b74149.zip
IR: add compileError builtin fn
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 8310cdf636..69df7d42cf 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -670,6 +670,12 @@ static void ir_print_max_value(IrPrint *irp, IrInstructionMaxValue *instruction)
fprintf(irp->f, ")");
}
+static void ir_print_compile_err(IrPrint *irp, IrInstructionCompileErr *instruction) {
+ fprintf(irp->f, "@compileError(");
+ ir_print_other_instruction(irp, instruction->msg);
+ fprintf(irp->f, ")");
+}
+
static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
ir_print_prefix(irp, instruction);
switch (instruction->id) {
@@ -813,6 +819,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdMaxValue:
ir_print_max_value(irp, (IrInstructionMaxValue *)instruction);
break;
+ case IrInstructionIdCompileErr:
+ ir_print_compile_err(irp, (IrInstructionCompileErr *)instruction);
+ break;
}
fprintf(irp->f, "\n");
}