diff options
| author | Jonathan Marler <jonathan.j.marler@hp.com> | 2019-08-23 09:33:33 -0600 |
|---|---|---|
| committer | Jonathan Marler <johnnymarler@gmail.com> | 2019-09-03 22:50:29 -0600 |
| commit | b728cb6d4e882592129eef2e37f8fcd8fda78822 (patch) | |
| tree | 9929bf826b52e9c29dfaa8c8eee930504d788a3f /src/ir_print.cpp | |
| parent | 77a5f888be664f9ef09e2c93f52338448e992e00 (diff) | |
| download | zig-b728cb6d4e882592129eef2e37f8fcd8fda78822.tar.gz zig-b728cb6d4e882592129eef2e37f8fcd8fda78822.zip | |
Add @Type builtin
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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; |
