Add @Type builtin
This commit is contained in:
committed by
Jonathan Marler
parent
77a5f888be
commit
b728cb6d4e
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user