ability to specify tag type of enums

see #305
This commit is contained in:
Andrew Kelley
2017-11-30 21:46:02 -05:00
parent 5786df933d
commit b62e2fd870
11 changed files with 180 additions and 6 deletions

View File

@@ -994,6 +994,12 @@ static void ir_print_arg_type(IrPrint *irp, IrInstructionArgType *instruction) {
fprintf(irp->f, ")");
}
static void ir_print_enum_tag_type(IrPrint *irp, IrInstructionEnumTagType *instruction) {
fprintf(irp->f, "@EnumTagType(");
ir_print_other_instruction(irp, instruction->target);
fprintf(irp->f, ")");
}
static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
ir_print_prefix(irp, instruction);
@@ -1312,6 +1318,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdArgType:
ir_print_arg_type(irp, (IrInstructionArgType *)instruction);
break;
case IrInstructionIdEnumTagType:
ir_print_enum_tag_type(irp, (IrInstructionEnumTagType *)instruction);
break;
}
fprintf(irp->f, "\n");
}