From fb2157063060682a314cb8f2e34efc7989646455 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 11 Dec 2016 19:43:06 -0500 Subject: IR: implement alloca builtin --- src/ir_print.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/ir_print.cpp') 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; -- cgit v1.2.3