Optimized field ptr ir for hot path and fix assignment bug
This commit is contained in:
@@ -358,10 +358,18 @@ static void ir_print_ptr_type_child(IrPrint *irp, IrInstructionPtrTypeChild *ins
|
||||
}
|
||||
|
||||
static void ir_print_field_ptr(IrPrint *irp, IrInstructionFieldPtr *instruction) {
|
||||
fprintf(irp->f, "fieldptr ");
|
||||
ir_print_other_instruction(irp, instruction->container_ptr);
|
||||
fprintf(irp->f, ".");
|
||||
ir_print_other_instruction(irp, instruction->field_name_expr);
|
||||
if (instruction->field_name_buffer) {
|
||||
fprintf(irp->f, "fieldptr ");
|
||||
ir_print_other_instruction(irp, instruction->container_ptr);
|
||||
fprintf(irp->f, ".%s", buf_ptr(instruction->field_name_buffer));
|
||||
} else {
|
||||
assert(instruction->field_name_expr);
|
||||
fprintf(irp->f, "@field(");
|
||||
ir_print_other_instruction(irp, instruction->container_ptr);
|
||||
fprintf(irp->f, ", ");
|
||||
ir_print_other_instruction(irp, instruction->field_name_expr);
|
||||
fprintf(irp->f, ")");
|
||||
}
|
||||
}
|
||||
|
||||
static void ir_print_struct_field_ptr(IrPrint *irp, IrInstructionStructFieldPtr *instruction) {
|
||||
|
||||
Reference in New Issue
Block a user