aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-11 19:43:06 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-11 19:43:06 -0500
commitfb2157063060682a314cb8f2e34efc7989646455 (patch)
tree2fb7f3c638d82a6816720d1e0cf04f6373fc9191 /src/ir_print.cpp
parenta963fba246819e8b71777db157ad9578086ea16e (diff)
downloadzig-fb2157063060682a314cb8f2e34efc7989646455.tar.gz
zig-fb2157063060682a314cb8f2e34efc7989646455.zip
IR: implement alloca builtin
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 b4bb0ee7c6..1adebca1fa 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -753,6 +753,14 @@ static void ir_print_truncate(IrPrint *irp, IrInstructionTruncate *instruction)
fprintf(irp->f, ")");
}
+static void ir_print_alloca(IrPrint *irp, IrInstructionAlloca *instruction) {
+ fprintf(irp->f, "@alloca(");
+ ir_print_other_instruction(irp, instruction->type_value);
+ fprintf(irp->f, ", ");
+ ir_print_other_instruction(irp, instruction->count);
+ fprintf(irp->f, ")");
+}
+
static void ir_print_int_type(IrPrint *irp, IrInstructionIntType *instruction) {
fprintf(irp->f, "@intType(");
ir_print_other_instruction(irp, instruction->is_signed);
@@ -942,6 +950,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdTruncate:
ir_print_truncate(irp, (IrInstructionTruncate *)instruction);
break;
+ case IrInstructionIdAlloca:
+ ir_print_alloca(irp, (IrInstructionAlloca *)instruction);
+ break;
case IrInstructionIdIntType:
ir_print_int_type(irp, (IrInstructionIntType *)instruction);
break;