From b728cb6d4e882592129eef2e37f8fcd8fda78822 Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Fri, 23 Aug 2019 09:33:33 -0600 Subject: Add @Type 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 6de585ec6f..25eb01365f 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -280,6 +280,8 @@ static const char* ir_instruction_type_str(IrInstruction* instruction) { return "BitOffsetOf"; case IrInstructionIdTypeInfo: return "TypeInfo"; + case IrInstructionIdType: + return "Type"; case IrInstructionIdHasField: return "HasField"; case IrInstructionIdTypeId: @@ -1627,6 +1629,12 @@ static void ir_print_type_info(IrPrint *irp, IrInstructionTypeInfo *instruction) fprintf(irp->f, ")"); } +static void ir_print_type(IrPrint *irp, IrInstructionType *instruction) { + fprintf(irp->f, "@Type("); + ir_print_other_instruction(irp, instruction->type_info); + fprintf(irp->f, ")"); +} + static void ir_print_has_field(IrPrint *irp, IrInstructionHasField *instruction) { fprintf(irp->f, "@hasField("); ir_print_other_instruction(irp, instruction->container_type); @@ -2258,6 +2266,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction, bool case IrInstructionIdTypeInfo: ir_print_type_info(irp, (IrInstructionTypeInfo *)instruction); break; + case IrInstructionIdType: + ir_print_type(irp, (IrInstructionType *)instruction); + break; case IrInstructionIdHasField: ir_print_has_field(irp, (IrInstructionHasField *)instruction); break; -- cgit v1.2.3