| ... | @@ -891,6 +891,10 @@ static constexpr IrInstructionId ir_instruction_id(IrInstructionAlignCast *) { | ... | @@ -891,6 +891,10 @@ static constexpr IrInstructionId ir_instruction_id(IrInstructionAlignCast *) { |
| 891 | return IrInstructionIdAlignCast; | 891 | return IrInstructionIdAlignCast; |
| 892 | } | 892 | } |
| 893 | | 893 | |
| | 894 | static constexpr IrInstructionId ir_instruction_id(IrInstructionImplicitCast *) { |
| | 895 | return IrInstructionIdImplicitCast; |
| | 896 | } |
| | 897 | |
| 894 | static constexpr IrInstructionId ir_instruction_id(IrInstructionOpaqueType *) { | 898 | static constexpr IrInstructionId ir_instruction_id(IrInstructionOpaqueType *) { |
| 895 | return IrInstructionIdOpaqueType; | 899 | return IrInstructionIdOpaqueType; |
| 896 | } | 900 | } |
| ... | @@ -1574,17 +1578,15 @@ static IrInstruction *ir_build_store_ptr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -1574,17 +1578,15 @@ static IrInstruction *ir_build_store_ptr(IrBuilder *irb, Scope *scope, AstNode * |
| 1574 | } | 1578 | } |
| 1575 | | 1579 | |
| 1576 | static IrInstruction *ir_build_var_decl_src(IrBuilder *irb, Scope *scope, AstNode *source_node, | 1580 | static IrInstruction *ir_build_var_decl_src(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| 1577 | ZigVar *var, IrInstruction *var_type, IrInstruction *align_value, IrInstruction *ptr) | 1581 | ZigVar *var, IrInstruction *align_value, IrInstruction *ptr) |
| 1578 | { | 1582 | { |
| 1579 | IrInstructionDeclVarSrc *decl_var_instruction = ir_build_instruction<IrInstructionDeclVarSrc>(irb, scope, source_node); | 1583 | IrInstructionDeclVarSrc *decl_var_instruction = ir_build_instruction<IrInstructionDeclVarSrc>(irb, scope, source_node); |
| 1580 | decl_var_instruction->base.value.special = ConstValSpecialStatic; | 1584 | decl_var_instruction->base.value.special = ConstValSpecialStatic; |
| 1581 | decl_var_instruction->base.value.type = irb->codegen->builtin_types.entry_void; | 1585 | decl_var_instruction->base.value.type = irb->codegen->builtin_types.entry_void; |
| 1582 | decl_var_instruction->var = var; | 1586 | decl_var_instruction->var = var; |
| 1583 | decl_var_instruction->var_type = var_type; | | |
| 1584 | decl_var_instruction->align_value = align_value; | 1587 | decl_var_instruction->align_value = align_value; |
| 1585 | decl_var_instruction->ptr = ptr; | 1588 | decl_var_instruction->ptr = ptr; |
| 1586 | | 1589 | |
| 1587 | if (var_type != nullptr) ir_ref_instruction(var_type, irb->current_basic_block); | | |
| 1588 | if (align_value != nullptr) ir_ref_instruction(align_value, irb->current_basic_block); | 1590 | if (align_value != nullptr) ir_ref_instruction(align_value, irb->current_basic_block); |
| 1589 | ir_ref_instruction(ptr, irb->current_basic_block); | 1591 | ir_ref_instruction(ptr, irb->current_basic_block); |
| 1590 | | 1592 | |
| ... | @@ -1655,27 +1657,6 @@ static IrInstruction *ir_build_typeof(IrBuilder *irb, Scope *scope, AstNode *sou | ... | @@ -1655,27 +1657,6 @@ static IrInstruction *ir_build_typeof(IrBuilder *irb, Scope *scope, AstNode *sou |
| 1655 | return &instruction->base; | 1657 | return &instruction->base; |
| 1656 | } | 1658 | } |
| 1657 | | 1659 | |
| 1658 | static IrInstruction *ir_build_to_ptr_type(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction *ptr) { | | |
| 1659 | IrInstructionToPtrType *instruction = ir_build_instruction<IrInstructionToPtrType>(irb, scope, source_node); | | |
| 1660 | instruction->ptr = ptr; | | |
| 1661 | | | |
| 1662 | ir_ref_instruction(ptr, irb->current_basic_block); | | |
| 1663 | | | |
| 1664 | return &instruction->base; | | |
| 1665 | } | | |
| 1666 | | | |
| 1667 | static IrInstruction *ir_build_ptr_type_child(IrBuilder *irb, Scope *scope, AstNode *source_node, | | |
| 1668 | IrInstruction *value) | | |
| 1669 | { | | |
| 1670 | IrInstructionPtrTypeChild *instruction = ir_build_instruction<IrInstructionPtrTypeChild>( | | |
| 1671 | irb, scope, source_node); | | |
| 1672 | instruction->value = value; | | |
| 1673 | | | |
| 1674 | ir_ref_instruction(value, irb->current_basic_block); | | |
| 1675 | | | |
| 1676 | return &instruction->base; | | |
| 1677 | } | | |
| 1678 | | | |
| 1679 | static IrInstruction *ir_build_set_cold(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction *is_cold) { | 1660 | static IrInstruction *ir_build_set_cold(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction *is_cold) { |
| 1680 | IrInstructionSetCold *instruction = ir_build_instruction<IrInstructionSetCold>(irb, scope, source_node); | 1661 | IrInstructionSetCold *instruction = ir_build_instruction<IrInstructionSetCold>(irb, scope, source_node); |
| 1681 | instruction->is_cold = is_cold; | 1662 | instruction->is_cold = is_cold; |
| ... | @@ -2780,6 +2761,19 @@ static IrInstruction *ir_build_align_cast(IrBuilder *irb, Scope *scope, AstNode | ... | @@ -2780,6 +2761,19 @@ static IrInstruction *ir_build_align_cast(IrBuilder *irb, Scope *scope, AstNode |
| 2780 | return &instruction->base; | 2761 | return &instruction->base; |
| 2781 | } | 2762 | } |
| 2782 | | 2763 | |
| | 2764 | static IrInstruction *ir_build_implicit_cast(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| | 2765 | IrInstruction *dest_type, IrInstruction *target) |
| | 2766 | { |
| | 2767 | IrInstructionImplicitCast *instruction = ir_build_instruction<IrInstructionImplicitCast>(irb, scope, source_node); |
| | 2768 | instruction->dest_type = dest_type; |
| | 2769 | instruction->target = target; |
| | 2770 | |
| | 2771 | ir_ref_instruction(dest_type, irb->current_basic_block); |
| | 2772 | ir_ref_instruction(target, irb->current_basic_block); |
| | 2773 | |
| | 2774 | return &instruction->base; |
| | 2775 | } |
| | 2776 | |
| 2783 | static IrInstruction *ir_build_opaque_type(IrBuilder *irb, Scope *scope, AstNode *source_node) { | 2777 | static IrInstruction *ir_build_opaque_type(IrBuilder *irb, Scope *scope, AstNode *source_node) { |
| 2784 | IrInstructionOpaqueType *instruction = ir_build_instruction<IrInstructionOpaqueType>(irb, scope, source_node); | 2778 | IrInstructionOpaqueType *instruction = ir_build_instruction<IrInstructionOpaqueType>(irb, scope, source_node); |
| 2785 | | 2779 | |
| ... | @@ -3199,11 +3193,10 @@ static IrInstructionAllocaGen *ir_create_alloca_gen(IrAnalyze *ira, IrInstructio | ... | @@ -3199,11 +3193,10 @@ static IrInstructionAllocaGen *ir_create_alloca_gen(IrAnalyze *ira, IrInstructio |
| 3199 | } | 3193 | } |
| 3200 | | 3194 | |
| 3201 | static IrInstruction *ir_build_end_expr(IrBuilder *irb, Scope *scope, AstNode *source_node, | 3195 | static IrInstruction *ir_build_end_expr(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| 3202 | IrInstruction *value, LVal lval, ResultLoc *result_loc) | 3196 | IrInstruction *value, ResultLoc *result_loc) |
| 3203 | { | 3197 | { |
| 3204 | IrInstructionEndExpr *instruction = ir_build_instruction<IrInstructionEndExpr>(irb, scope, source_node); | 3198 | IrInstructionEndExpr *instruction = ir_build_instruction<IrInstructionEndExpr>(irb, scope, source_node); |
| 3205 | instruction->value = value; | 3199 | instruction->value = value; |
| 3206 | instruction->lval = lval; | | |
| 3207 | instruction->result_loc = result_loc; | 3200 | instruction->result_loc = result_loc; |
| 3208 | | 3201 | |
| 3209 | ir_ref_instruction(value, irb->current_basic_block); | 3202 | ir_ref_instruction(value, irb->current_basic_block); |
| ... | @@ -5399,8 +5392,7 @@ static IrInstruction *ir_gen_prefix_op_id(IrBuilder *irb, Scope *scope, AstNode | ... | @@ -5399,8 +5392,7 @@ static IrInstruction *ir_gen_prefix_op_id(IrBuilder *irb, Scope *scope, AstNode |
| 5399 | } | 5392 | } |
| 5400 | | 5393 | |
| 5401 | static IrInstruction *ir_expr_wrap(IrBuilder *irb, Scope *scope, IrInstruction *inst, ResultLoc *result_loc) { | 5394 | static IrInstruction *ir_expr_wrap(IrBuilder *irb, Scope *scope, IrInstruction *inst, ResultLoc *result_loc) { |
| 5402 | // TODO remove the lval parameter here | 5395 | ir_build_end_expr(irb, scope, inst->source_node, inst, result_loc); |
| 5403 | ir_build_end_expr(irb, scope, inst->source_node, inst, LValNone, result_loc); | | |
| 5404 | return inst; | 5396 | return inst; |
| 5405 | } | 5397 | } |
| 5406 | | 5398 | |
| ... | @@ -5607,9 +5599,12 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod | ... | @@ -5607,9 +5599,12 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod |
| 5607 | return irb->codegen->invalid_instruction; | 5599 | return irb->codegen->invalid_instruction; |
| 5608 | } | 5600 | } |
| 5609 | | 5601 | |
| | 5602 | // Used for the type expr and the align expr |
| | 5603 | Scope *comptime_scope = create_comptime_scope(irb->codegen, node, scope); |
| | 5604 | |
| 5610 | IrInstruction *type_instruction; | 5605 | IrInstruction *type_instruction; |
| 5611 | if (variable_declaration->type != nullptr) { | 5606 | if (variable_declaration->type != nullptr) { |
| 5612 | type_instruction = ir_gen_node(irb, variable_declaration->type, scope); | 5607 | type_instruction = ir_gen_node(irb, variable_declaration->type, comptime_scope); |
| 5613 | if (type_instruction == irb->codegen->invalid_instruction) | 5608 | if (type_instruction == irb->codegen->invalid_instruction) |
| 5614 | return type_instruction; | 5609 | return type_instruction; |
| 5615 | } else { | 5610 | } else { |
| ... | @@ -5635,7 +5630,7 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod | ... | @@ -5635,7 +5630,7 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod |
| 5635 | | 5630 | |
| 5636 | IrInstruction *align_value = nullptr; | 5631 | IrInstruction *align_value = nullptr; |
| 5637 | if (variable_declaration->align_expr != nullptr) { | 5632 | if (variable_declaration->align_expr != nullptr) { |
| 5638 | align_value = ir_gen_node(irb, variable_declaration->align_expr, scope); | 5633 | align_value = ir_gen_node(irb, variable_declaration->align_expr, comptime_scope); |
| 5639 | if (align_value == irb->codegen->invalid_instruction) | 5634 | if (align_value == irb->codegen->invalid_instruction) |
| 5640 | return align_value; | 5635 | return align_value; |
| 5641 | } | 5636 | } |
| ... | @@ -5656,19 +5651,24 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod | ... | @@ -5656,19 +5651,24 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod |
| 5656 | result_loc_var->base.id = ResultLocIdVar; | 5651 | result_loc_var->base.id = ResultLocIdVar; |
| 5657 | result_loc_var->base.source_instruction = alloca; | 5652 | result_loc_var->base.source_instruction = alloca; |
| 5658 | result_loc_var->var = var; | 5653 | result_loc_var->var = var; |
| | 5654 | ResultLoc *init_result_loc = (type_instruction == nullptr) ? &result_loc_var->base : nullptr; |
| 5659 | | 5655 | |
| 5660 | // Temporarily set the name of the IrExecutable to the VariableDeclaration | 5656 | // Temporarily set the name of the IrExecutable to the VariableDeclaration |
| 5661 | // so that the struct or enum from the init expression inherits the name. | 5657 | // so that the struct or enum from the init expression inherits the name. |
| 5662 | Buf *old_exec_name = irb->exec->name; | 5658 | Buf *old_exec_name = irb->exec->name; |
| 5663 | irb->exec->name = variable_declaration->symbol; | 5659 | irb->exec->name = variable_declaration->symbol; |
| 5664 | IrInstruction *init_value = ir_gen_node_extra(irb, variable_declaration->expr, scope, LValNone, | 5660 | IrInstruction *init_value = ir_gen_node_extra(irb, variable_declaration->expr, scope, LValNone, init_result_loc); |
| 5665 | &result_loc_var->base); | | |
| 5666 | irb->exec->name = old_exec_name; | 5661 | irb->exec->name = old_exec_name; |
| 5667 | | 5662 | |
| 5668 | if (init_value == irb->codegen->invalid_instruction) | 5663 | if (init_value == irb->codegen->invalid_instruction) |
| 5669 | return init_value; | 5664 | return irb->codegen->invalid_instruction; |
| | 5665 | |
| | 5666 | if (type_instruction != nullptr) { |
| | 5667 | IrInstruction *implicit_cast = ir_build_implicit_cast(irb, scope, node, type_instruction, init_value); |
| | 5668 | ir_build_end_expr(irb, scope, node, implicit_cast, &result_loc_var->base); |
| | 5669 | } |
| 5670 | | 5670 | |
| 5671 | return ir_build_var_decl_src(irb, scope, node, var, type_instruction, align_value, alloca); | 5671 | return ir_build_var_decl_src(irb, scope, node, var, align_value, alloca); |
| 5672 | } | 5672 | } |
| 5673 | | 5673 | |
| 5674 | static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *node) { | 5674 | static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *node) { |
| ... | @@ -5725,7 +5725,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5725,7 +5725,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n |
| 5725 | err_val_ptr, false); | 5725 | err_val_ptr, false); |
| 5726 | IrInstruction *var_value = node->data.while_expr.var_is_ptr ? | 5726 | IrInstruction *var_value = node->data.while_expr.var_is_ptr ? |
| 5727 | var_ptr_value : ir_build_load_ptr(irb, payload_scope, symbol_node, var_ptr_value); | 5727 | var_ptr_value : ir_build_load_ptr(irb, payload_scope, symbol_node, var_ptr_value); |
| 5728 | ir_build_var_decl_src(irb, payload_scope, symbol_node, payload_var, nullptr, nullptr, var_value); | 5728 | ir_build_var_decl_src(irb, payload_scope, symbol_node, payload_var, nullptr, var_value); |
| 5729 | } | 5729 | } |
| 5730 | | 5730 | |
| 5731 | ZigList<IrInstruction *> incoming_values = {0}; | 5731 | ZigList<IrInstruction *> incoming_values = {0}; |
| ... | @@ -5767,7 +5767,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5767,7 +5767,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n |
| 5767 | true, false, false, is_comptime); | 5767 | true, false, false, is_comptime); |
| 5768 | Scope *err_scope = err_var->child_scope; | 5768 | Scope *err_scope = err_var->child_scope; |
| 5769 | IrInstruction *err_var_value = ir_build_unwrap_err_code(irb, err_scope, err_symbol_node, err_val_ptr); | 5769 | IrInstruction *err_var_value = ir_build_unwrap_err_code(irb, err_scope, err_symbol_node, err_val_ptr); |
| 5770 | ir_build_var_decl_src(irb, err_scope, symbol_node, err_var, nullptr, nullptr, err_var_value); | 5770 | ir_build_var_decl_src(irb, err_scope, symbol_node, err_var, nullptr, err_var_value); |
| 5771 | | 5771 | |
| 5772 | IrInstruction *else_result = ir_gen_node(irb, else_node, err_scope); | 5772 | IrInstruction *else_result = ir_gen_node(irb, else_node, err_scope); |
| 5773 | if (else_result == irb->codegen->invalid_instruction) | 5773 | if (else_result == irb->codegen->invalid_instruction) |
| ... | @@ -5811,7 +5811,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5811,7 +5811,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n |
| 5811 | IrInstruction *var_ptr_value = ir_build_optional_unwrap_ptr(irb, child_scope, symbol_node, maybe_val_ptr, false); | 5811 | IrInstruction *var_ptr_value = ir_build_optional_unwrap_ptr(irb, child_scope, symbol_node, maybe_val_ptr, false); |
| 5812 | IrInstruction *var_value = node->data.while_expr.var_is_ptr ? | 5812 | IrInstruction *var_value = node->data.while_expr.var_is_ptr ? |
| 5813 | var_ptr_value : ir_build_load_ptr(irb, child_scope, symbol_node, var_ptr_value); | 5813 | var_ptr_value : ir_build_load_ptr(irb, child_scope, symbol_node, var_ptr_value); |
| 5814 | ir_build_var_decl_src(irb, child_scope, symbol_node, payload_var, nullptr, nullptr, var_value); | 5814 | ir_build_var_decl_src(irb, child_scope, symbol_node, payload_var, nullptr, var_value); |
| 5815 | | 5815 | |
| 5816 | ZigList<IrInstruction *> incoming_values = {0}; | 5816 | ZigList<IrInstruction *> incoming_values = {0}; |
| 5817 | ZigList<IrBasicBlock *> incoming_blocks = {0}; | 5817 | ZigList<IrBasicBlock *> incoming_blocks = {0}; |
| ... | @@ -5953,14 +5953,6 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo | ... | @@ -5953,14 +5953,6 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo |
| 5953 | if (array_val_ptr == irb->codegen->invalid_instruction) | 5953 | if (array_val_ptr == irb->codegen->invalid_instruction) |
| 5954 | return array_val_ptr; | 5954 | return array_val_ptr; |
| 5955 | | 5955 | |
| 5956 | IrInstruction *pointer_type = ir_build_to_ptr_type(irb, parent_scope, array_node, array_val_ptr); | | |
| 5957 | IrInstruction *elem_var_type; | | |
| 5958 | if (node->data.for_expr.elem_is_ptr) { | | |
| 5959 | elem_var_type = pointer_type; | | |
| 5960 | } else { | | |
| 5961 | elem_var_type = ir_build_ptr_type_child(irb, parent_scope, elem_node, pointer_type); | | |
| 5962 | } | | |
| 5963 | | | |
| 5964 | IrInstruction *is_comptime = ir_build_const_bool(irb, parent_scope, node, | 5956 | IrInstruction *is_comptime = ir_build_const_bool(irb, parent_scope, node, |
| 5965 | ir_should_inline(irb->exec, parent_scope) || node->data.for_expr.is_inline); | 5957 | ir_should_inline(irb->exec, parent_scope) || node->data.for_expr.is_inline); |
| 5966 | | 5958 | |
| ... | @@ -5970,7 +5962,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo | ... | @@ -5970,7 +5962,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo |
| 5970 | Scope *child_scope = elem_var->child_scope; | 5962 | Scope *child_scope = elem_var->child_scope; |
| 5971 | | 5963 | |
| 5972 | IrInstruction *undefined_value = ir_build_const_undefined(irb, child_scope, elem_node); | 5964 | IrInstruction *undefined_value = ir_build_const_undefined(irb, child_scope, elem_node); |
| 5973 | ir_build_var_decl_src(irb, child_scope, elem_node, elem_var, elem_var_type, nullptr, undefined_value); | 5965 | ir_build_var_decl_src(irb, child_scope, elem_node, elem_var, nullptr, undefined_value); |
| 5974 | IrInstruction *elem_var_ptr = ir_build_var_ptr(irb, child_scope, node, elem_var); | 5966 | IrInstruction *elem_var_ptr = ir_build_var_ptr(irb, child_scope, node, elem_var); |
| 5975 | | 5967 | |
| 5976 | AstNode *index_var_source_node; | 5968 | AstNode *index_var_source_node; |
| ... | @@ -5985,10 +5977,9 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo | ... | @@ -5985,10 +5977,9 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo |
| 5985 | } | 5977 | } |
| 5986 | child_scope = index_var->child_scope; | 5978 | child_scope = index_var->child_scope; |
| 5987 | | 5979 | |
| 5988 | IrInstruction *usize = ir_build_const_type(irb, child_scope, node, irb->codegen->builtin_types.entry_usize); | | |
| 5989 | IrInstruction *zero = ir_build_const_usize(irb, child_scope, node, 0); | 5980 | IrInstruction *zero = ir_build_const_usize(irb, child_scope, node, 0); |
| 5990 | IrInstruction *one = ir_build_const_usize(irb, child_scope, node, 1); | 5981 | IrInstruction *one = ir_build_const_usize(irb, child_scope, node, 1); |
| 5991 | ir_build_var_decl_src(irb, child_scope, index_var_source_node, index_var, usize, nullptr, zero); | 5982 | ir_build_var_decl_src(irb, child_scope, index_var_source_node, index_var, nullptr, zero); |
| 5992 | IrInstruction *index_ptr = ir_build_var_ptr(irb, child_scope, node, index_var); | 5983 | IrInstruction *index_ptr = ir_build_var_ptr(irb, child_scope, node, index_var); |
| 5993 | | 5984 | |
| 5994 | | 5985 | |
| ... | @@ -6380,7 +6371,6 @@ static IrInstruction *ir_gen_if_optional_expr(IrBuilder *irb, Scope *scope, AstN | ... | @@ -6380,7 +6371,6 @@ static IrInstruction *ir_gen_if_optional_expr(IrBuilder *irb, Scope *scope, AstN |
| 6380 | Scope *subexpr_scope = create_runtime_scope(irb->codegen, node, scope, is_comptime); | 6371 | Scope *subexpr_scope = create_runtime_scope(irb->codegen, node, scope, is_comptime); |
| 6381 | Scope *var_scope; | 6372 | Scope *var_scope; |
| 6382 | if (var_symbol) { | 6373 | if (var_symbol) { |
| 6383 | IrInstruction *var_type = nullptr; | | |
| 6384 | bool is_shadowable = false; | 6374 | bool is_shadowable = false; |
| 6385 | bool is_const = true; | 6375 | bool is_const = true; |
| 6386 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, | 6376 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, |
| ... | @@ -6388,7 +6378,7 @@ static IrInstruction *ir_gen_if_optional_expr(IrBuilder *irb, Scope *scope, AstN | ... | @@ -6388,7 +6378,7 @@ static IrInstruction *ir_gen_if_optional_expr(IrBuilder *irb, Scope *scope, AstN |
| 6388 | | 6378 | |
| 6389 | IrInstruction *var_ptr_value = ir_build_optional_unwrap_ptr(irb, subexpr_scope, node, maybe_val_ptr, false); | 6379 | IrInstruction *var_ptr_value = ir_build_optional_unwrap_ptr(irb, subexpr_scope, node, maybe_val_ptr, false); |
| 6390 | IrInstruction *var_value = var_is_ptr ? var_ptr_value : ir_build_load_ptr(irb, subexpr_scope, node, var_ptr_value); | 6380 | IrInstruction *var_value = var_is_ptr ? var_ptr_value : ir_build_load_ptr(irb, subexpr_scope, node, var_ptr_value); |
| 6391 | ir_build_var_decl_src(irb, subexpr_scope, node, var, var_type, nullptr, var_value); | 6381 | ir_build_var_decl_src(irb, subexpr_scope, node, var, nullptr, var_value); |
| 6392 | var_scope = var->child_scope; | 6382 | var_scope = var->child_scope; |
| 6393 | } else { | 6383 | } else { |
| 6394 | var_scope = subexpr_scope; | 6384 | var_scope = subexpr_scope; |
| ... | @@ -6455,7 +6445,6 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -6455,7 +6445,6 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * |
| 6455 | Scope *subexpr_scope = create_runtime_scope(irb->codegen, node, scope, is_comptime); | 6445 | Scope *subexpr_scope = create_runtime_scope(irb->codegen, node, scope, is_comptime); |
| 6456 | Scope *var_scope; | 6446 | Scope *var_scope; |
| 6457 | if (var_symbol) { | 6447 | if (var_symbol) { |
| 6458 | IrInstruction *var_type = nullptr; | | |
| 6459 | bool is_shadowable = false; | 6448 | bool is_shadowable = false; |
| 6460 | IrInstruction *var_is_comptime = force_comptime ? ir_build_const_bool(irb, subexpr_scope, node, true) : ir_build_test_comptime(irb, subexpr_scope, node, err_val); | 6449 | IrInstruction *var_is_comptime = force_comptime ? ir_build_const_bool(irb, subexpr_scope, node, true) : ir_build_test_comptime(irb, subexpr_scope, node, err_val); |
| 6461 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, | 6450 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, |
| ... | @@ -6463,7 +6452,7 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -6463,7 +6452,7 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * |
| 6463 | | 6452 | |
| 6464 | IrInstruction *var_ptr_value = ir_build_unwrap_err_payload(irb, subexpr_scope, node, err_val_ptr, false); | 6453 | IrInstruction *var_ptr_value = ir_build_unwrap_err_payload(irb, subexpr_scope, node, err_val_ptr, false); |
| 6465 | IrInstruction *var_value = var_is_ptr ? var_ptr_value : ir_build_load_ptr(irb, subexpr_scope, node, var_ptr_value); | 6454 | IrInstruction *var_value = var_is_ptr ? var_ptr_value : ir_build_load_ptr(irb, subexpr_scope, node, var_ptr_value); |
| 6466 | ir_build_var_decl_src(irb, subexpr_scope, node, var, var_type, nullptr, var_value); | 6455 | ir_build_var_decl_src(irb, subexpr_scope, node, var, nullptr, var_value); |
| 6467 | var_scope = var->child_scope; | 6456 | var_scope = var->child_scope; |
| 6468 | } else { | 6457 | } else { |
| 6469 | var_scope = subexpr_scope; | 6458 | var_scope = subexpr_scope; |
| ... | @@ -6481,14 +6470,13 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -6481,14 +6470,13 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * |
| 6481 | if (else_node) { | 6470 | if (else_node) { |
| 6482 | Scope *err_var_scope; | 6471 | Scope *err_var_scope; |
| 6483 | if (err_symbol) { | 6472 | if (err_symbol) { |
| 6484 | IrInstruction *var_type = nullptr; | | |
| 6485 | bool is_shadowable = false; | 6473 | bool is_shadowable = false; |
| 6486 | bool is_const = true; | 6474 | bool is_const = true; |
| 6487 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, | 6475 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, |
| 6488 | err_symbol, is_const, is_const, is_shadowable, is_comptime); | 6476 | err_symbol, is_const, is_const, is_shadowable, is_comptime); |
| 6489 | | 6477 | |
| 6490 | IrInstruction *var_value = ir_build_unwrap_err_code(irb, subexpr_scope, node, err_val_ptr); | 6478 | IrInstruction *var_value = ir_build_unwrap_err_code(irb, subexpr_scope, node, err_val_ptr); |
| 6491 | ir_build_var_decl_src(irb, subexpr_scope, node, var, var_type, nullptr, var_value); | 6479 | ir_build_var_decl_src(irb, subexpr_scope, node, var, nullptr, var_value); |
| 6492 | err_var_scope = var->child_scope; | 6480 | err_var_scope = var->child_scope; |
| 6493 | } else { | 6481 | } else { |
| 6494 | err_var_scope = subexpr_scope; | 6482 | err_var_scope = subexpr_scope; |
| ... | @@ -6551,8 +6539,7 @@ static bool ir_gen_switch_prong_expr(IrBuilder *irb, Scope *scope, AstNode *swit | ... | @@ -6551,8 +6539,7 @@ static bool ir_gen_switch_prong_expr(IrBuilder *irb, Scope *scope, AstNode *swit |
| 6551 | var_value = var_is_ptr ? target_value_ptr : ir_build_load_ptr(irb, scope, var_symbol_node, | 6539 | var_value = var_is_ptr ? target_value_ptr : ir_build_load_ptr(irb, scope, var_symbol_node, |
| 6552 | target_value_ptr); | 6540 | target_value_ptr); |
| 6553 | } | 6541 | } |
| 6554 | IrInstruction *var_type = nullptr; // infer the type | 6542 | ir_build_var_decl_src(irb, scope, var_symbol_node, var, nullptr, var_value); |
| 6555 | ir_build_var_decl_src(irb, scope, var_symbol_node, var, var_type, nullptr, var_value); | | |
| 6556 | } else { | 6543 | } else { |
| 6557 | child_scope = scope; | 6544 | child_scope = scope; |
| 6558 | } | 6545 | } |
| ... | @@ -7018,7 +7005,7 @@ static IrInstruction *ir_gen_catch(IrBuilder *irb, Scope *parent_scope, AstNode | ... | @@ -7018,7 +7005,7 @@ static IrInstruction *ir_gen_catch(IrBuilder *irb, Scope *parent_scope, AstNode |
| 7018 | is_const, is_const, is_shadowable, is_comptime); | 7005 | is_const, is_const, is_shadowable, is_comptime); |
| 7019 | err_scope = var->child_scope; | 7006 | err_scope = var->child_scope; |
| 7020 | IrInstruction *err_val = ir_build_unwrap_err_code(irb, err_scope, node, err_union_ptr); | 7007 | IrInstruction *err_val = ir_build_unwrap_err_code(irb, err_scope, node, err_union_ptr); |
| 7021 | ir_build_var_decl_src(irb, err_scope, var_node, var, nullptr, nullptr, err_val); | 7008 | ir_build_var_decl_src(irb, err_scope, var_node, var, nullptr, err_val); |
| 7022 | } else { | 7009 | } else { |
| 7023 | err_scope = parent_scope; | 7010 | err_scope = parent_scope; |
| 7024 | } | 7011 | } |
| ... | @@ -7509,7 +7496,7 @@ static IrInstruction *ir_gen_await_expr(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -7509,7 +7496,7 @@ static IrInstruction *ir_gen_await_expr(IrBuilder *irb, Scope *scope, AstNode *n |
| 7509 | IrInstruction *target_promise_type = ir_build_typeof(irb, scope, node, target_inst); | 7496 | IrInstruction *target_promise_type = ir_build_typeof(irb, scope, node, target_inst); |
| 7510 | IrInstruction *promise_result_type = ir_build_promise_result_type(irb, scope, node, target_promise_type); | 7497 | IrInstruction *promise_result_type = ir_build_promise_result_type(irb, scope, node, target_promise_type); |
| 7511 | ir_build_await_bookkeeping(irb, scope, node, promise_result_type); | 7498 | ir_build_await_bookkeeping(irb, scope, node, promise_result_type); |
| 7512 | ir_build_var_decl_src(irb, scope, node, result_var, promise_result_type, nullptr, undefined_value); | 7499 | ir_build_var_decl_src(irb, scope, node, result_var, nullptr, undefined_value); |
| 7513 | IrInstruction *my_result_var_ptr = ir_build_var_ptr(irb, scope, node, result_var); | 7500 | IrInstruction *my_result_var_ptr = ir_build_var_ptr(irb, scope, node, result_var); |
| 7514 | ir_build_store_ptr(irb, scope, node, result_ptr_field_ptr, my_result_var_ptr); | 7501 | ir_build_store_ptr(irb, scope, node, result_ptr_field_ptr, my_result_var_ptr); |
| 7515 | IrInstruction *save_token = ir_build_coro_save(irb, scope, node, irb->exec->coro_handle); | 7502 | IrInstruction *save_token = ir_build_coro_save(irb, scope, node, irb->exec->coro_handle); |
| ... | @@ -7940,17 +7927,13 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec | ... | @@ -7940,17 +7927,13 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec |
| 7940 | | 7927 | |
| 7941 | return_type = fn_entry->type_entry->data.fn.fn_type_id.return_type; | 7928 | return_type = fn_entry->type_entry->data.fn.fn_type_id.return_type; |
| 7942 | IrInstruction *undef = ir_build_const_undefined(irb, coro_scope, node); | 7929 | IrInstruction *undef = ir_build_const_undefined(irb, coro_scope, node); |
| 7943 | ZigType *coro_frame_type = get_promise_frame_type(irb->codegen, return_type); | | |
| 7944 | IrInstruction *coro_frame_type_value = ir_build_const_type(irb, coro_scope, node, coro_frame_type); | | |
| 7945 | // TODO mark this var decl as "no safety" e.g. disable initializing the undef value to 0xaa | 7930 | // TODO mark this var decl as "no safety" e.g. disable initializing the undef value to 0xaa |
| 7946 | ir_build_var_decl_src(irb, coro_scope, node, promise_var, coro_frame_type_value, nullptr, undef); | 7931 | ir_build_var_decl_src(irb, coro_scope, node, promise_var, nullptr, undef); |
| 7947 | coro_promise_ptr = ir_build_var_ptr(irb, coro_scope, node, promise_var); | 7932 | coro_promise_ptr = ir_build_var_ptr(irb, coro_scope, node, promise_var); |
| 7948 | | 7933 | |
| 7949 | ZigVar *await_handle_var = ir_create_var(irb, node, coro_scope, nullptr, false, false, true, const_bool_false); | 7934 | ZigVar *await_handle_var = ir_create_var(irb, node, coro_scope, nullptr, false, false, true, const_bool_false); |
| 7950 | IrInstruction *null_value = ir_build_const_null(irb, coro_scope, node); | 7935 | IrInstruction *null_value = ir_build_const_null(irb, coro_scope, node); |
| 7951 | IrInstruction *await_handle_type_val = ir_build_const_type(irb, coro_scope, node, | 7936 | ir_build_var_decl_src(irb, coro_scope, node, await_handle_var, nullptr, null_value); |
| 7952 | get_optional_type(irb->codegen, irb->codegen->builtin_types.entry_promise)); | | |
| 7953 | ir_build_var_decl_src(irb, coro_scope, node, await_handle_var, await_handle_type_val, nullptr, null_value); | | |
| 7954 | irb->exec->await_handle_var_ptr = ir_build_var_ptr(irb, coro_scope, node, await_handle_var); | 7937 | irb->exec->await_handle_var_ptr = ir_build_var_ptr(irb, coro_scope, node, await_handle_var); |
| 7955 | | 7938 | |
| 7956 | u8_ptr_type = ir_build_const_type(irb, coro_scope, node, | 7939 | u8_ptr_type = ir_build_const_type(irb, coro_scope, node, |
| ... | @@ -7960,11 +7943,11 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec | ... | @@ -7960,11 +7943,11 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec |
| 7960 | coro_id = ir_build_coro_id(irb, coro_scope, node, promise_as_u8_ptr); | 7943 | coro_id = ir_build_coro_id(irb, coro_scope, node, promise_as_u8_ptr); |
| 7961 | coro_size_var = ir_create_var(irb, node, coro_scope, nullptr, false, false, true, const_bool_false); | 7944 | coro_size_var = ir_create_var(irb, node, coro_scope, nullptr, false, false, true, const_bool_false); |
| 7962 | IrInstruction *coro_size = ir_build_coro_size(irb, coro_scope, node); | 7945 | IrInstruction *coro_size = ir_build_coro_size(irb, coro_scope, node); |
| 7963 | ir_build_var_decl_src(irb, coro_scope, node, coro_size_var, nullptr, nullptr, coro_size); | 7946 | ir_build_var_decl_src(irb, coro_scope, node, coro_size_var, nullptr, coro_size); |
| 7964 | IrInstruction *implicit_allocator_ptr = ir_build_get_implicit_allocator(irb, coro_scope, node, | 7947 | IrInstruction *implicit_allocator_ptr = ir_build_get_implicit_allocator(irb, coro_scope, node, |
| 7965 | ImplicitAllocatorIdArg); | 7948 | ImplicitAllocatorIdArg); |
| 7966 | irb->exec->coro_allocator_var = ir_create_var(irb, node, coro_scope, nullptr, true, true, true, const_bool_false); | 7949 | irb->exec->coro_allocator_var = ir_create_var(irb, node, coro_scope, nullptr, true, true, true, const_bool_false); |
| 7967 | ir_build_var_decl_src(irb, coro_scope, node, irb->exec->coro_allocator_var, nullptr, nullptr, implicit_allocator_ptr); | 7950 | ir_build_var_decl_src(irb, coro_scope, node, irb->exec->coro_allocator_var, nullptr, implicit_allocator_ptr); |
| 7968 | Buf *realloc_field_name = buf_create_from_str(ASYNC_REALLOC_FIELD_NAME); | 7951 | Buf *realloc_field_name = buf_create_from_str(ASYNC_REALLOC_FIELD_NAME); |
| 7969 | IrInstruction *realloc_fn_ptr = ir_build_field_ptr(irb, coro_scope, node, implicit_allocator_ptr, realloc_field_name); | 7952 | IrInstruction *realloc_fn_ptr = ir_build_field_ptr(irb, coro_scope, node, implicit_allocator_ptr, realloc_field_name); |
| 7970 | IrInstruction *realloc_fn = ir_build_load_ptr(irb, coro_scope, node, realloc_fn_ptr); | 7953 | IrInstruction *realloc_fn = ir_build_load_ptr(irb, coro_scope, node, realloc_fn_ptr); |
| ... | @@ -14375,20 +14358,24 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, ResultLoc *result_loc, Z | ... | @@ -14375,20 +14358,24 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, ResultLoc *result_loc, Z |
| 14375 | case ResultLocIdNone: | 14358 | case ResultLocIdNone: |
| 14376 | return nullptr; | 14359 | return nullptr; |
| 14377 | case ResultLocIdVar: { | 14360 | case ResultLocIdVar: { |
| 14378 | // TODO implicit cast? | | |
| 14379 | ResultLocVar *result_loc_var = reinterpret_cast<ResultLocVar *>(result_loc); | 14361 | ResultLocVar *result_loc_var = reinterpret_cast<ResultLocVar *>(result_loc); |
| 14380 | assert(result_loc->source_instruction->id == IrInstructionIdAllocaSrc); | 14362 | assert(result_loc->source_instruction->id == IrInstructionIdAllocaSrc); |
| 14381 | IrInstructionAllocaSrc *alloca_src = | 14363 | IrInstructionAllocaSrc *alloca_src = |
| 14382 | reinterpret_cast<IrInstructionAllocaSrc *>(result_loc->source_instruction); | 14364 | reinterpret_cast<IrInstructionAllocaSrc *>(result_loc->source_instruction); |
| 14383 | if (alloca_src->base.child == nullptr) { | 14365 | if (alloca_src->base.child == nullptr) { |
| 14384 | uint32_t align = 0; // TODO | | |
| 14385 | bool force_comptime = false; // TODO | | |
| 14386 | bool is_comptime = value != nullptr && value->value.special != ConstValSpecialRuntime && | 14366 | bool is_comptime = value != nullptr && value->value.special != ConstValSpecialRuntime && |
| 14387 | result_loc_var->var->gen_is_const; | 14367 | result_loc_var->var->gen_is_const; |
| 14388 | IrInstruction *alloca_gen; | 14368 | IrInstruction *alloca_gen; |
| 14389 | if (is_comptime) { | 14369 | if (is_comptime) { |
| 14390 | alloca_gen = ir_get_ref(ira, result_loc->source_instruction, value, true, false); | 14370 | alloca_gen = ir_get_ref(ira, result_loc->source_instruction, value, true, false); |
| 14391 | } else { | 14371 | } else { |
| | 14372 | uint32_t align = 0; |
| | 14373 | if (alloca_src->align != nullptr && !ir_resolve_align(ira, alloca_src->align->child, &align)) { |
| | 14374 | return ira->codegen->invalid_instruction; |
| | 14375 | } |
| | 14376 | bool force_comptime; |
| | 14377 | if (!ir_resolve_comptime(ira, alloca_src->is_comptime->child, &force_comptime)) |
| | 14378 | return ira->codegen->invalid_instruction; |
| 14392 | alloca_gen = ir_analyze_alloca(ira, result_loc->source_instruction, value_type, align, | 14379 | alloca_gen = ir_analyze_alloca(ira, result_loc->source_instruction, value_type, align, |
| 14393 | alloca_src->name_hint, force_comptime); | 14380 | alloca_src->name_hint, force_comptime); |
| 14394 | } | 14381 | } |
| ... | @@ -14409,6 +14396,19 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, ResultLoc *result_loc, Z | ... | @@ -14409,6 +14396,19 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, ResultLoc *result_loc, Z |
| 14409 | zig_unreachable(); | 14396 | zig_unreachable(); |
| 14410 | } | 14397 | } |
| 14411 | | 14398 | |
| | 14399 | static IrInstruction *ir_analyze_instruction_implicit_cast(IrAnalyze *ira, IrInstructionImplicitCast *instruction) { |
| | 14400 | ZigType *dest_type = ir_resolve_type(ira, instruction->dest_type->child); |
| | 14401 | if (type_is_invalid(dest_type)) |
| | 14402 | return ira->codegen->invalid_instruction; |
| | 14403 | |
| | 14404 | IrInstruction *target = instruction->target->child; |
| | 14405 | if (type_is_invalid(target->value.type)) |
| | 14406 | return ira->codegen->invalid_instruction; |
| | 14407 | |
| | 14408 | return ir_implicit_cast(ira, target, dest_type); |
| | 14409 | } |
| | 14410 | |
| | 14411 | |
| 14412 | static IrInstruction *ir_analyze_async_call(IrAnalyze *ira, IrInstructionCallSrc *call_instruction, ZigFn *fn_entry, | 14412 | static IrInstruction *ir_analyze_async_call(IrAnalyze *ira, IrInstructionCallSrc *call_instruction, ZigFn *fn_entry, |
| 14413 | ZigType *fn_type, IrInstruction *fn_ref, IrInstruction **casted_args, size_t arg_count, | 14413 | ZigType *fn_type, IrInstruction *fn_ref, IrInstruction **casted_args, size_t arg_count, |
| 14414 | IrInstruction *async_allocator_inst) | 14414 | IrInstruction *async_allocator_inst) |
| ... | @@ -23612,8 +23612,6 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct | ... | @@ -23612,8 +23612,6 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct |
| 23612 | if (type_is_invalid(value->value.type)) | 23612 | if (type_is_invalid(value->value.type)) |
| 23613 | return ira->codegen->invalid_instruction; | 23613 | return ira->codegen->invalid_instruction; |
| 23614 | | 23614 | |
| 23615 | assert(instruction->lval == LValNone); | | |
| 23616 | | | |
| 23617 | if (instruction->result_loc->id == ResultLocIdPeer) { | 23615 | if (instruction->result_loc->id == ResultLocIdPeer) { |
| 23618 | ResultLocPeer *result_peer = reinterpret_cast<ResultLocPeer *>(instruction->result_loc); | 23616 | ResultLocPeer *result_peer = reinterpret_cast<ResultLocPeer *>(instruction->result_loc); |
| 23619 | ResultLocPeerParent *peer_parent = result_peer->parent; | 23617 | ResultLocPeerParent *peer_parent = result_peer->parent; |
| ... | @@ -23640,7 +23638,7 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct | ... | @@ -23640,7 +23638,7 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct |
| 23640 | } | 23638 | } |
| 23641 | } | 23639 | } |
| 23642 | IrInstruction *result_loc = ir_resolve_result(ira, instruction->result_loc, value->value.type, value); | 23640 | IrInstruction *result_loc = ir_resolve_result(ira, instruction->result_loc, value->value.type, value); |
| 23643 | if (result_loc != nullptr) { | 23641 | if (result_loc != nullptr && !type_is_invalid(result_loc->value.type)) { |
| 23644 | ir_analyze_store_ptr(ira, &instruction->base, result_loc, value); | 23642 | ir_analyze_store_ptr(ira, &instruction->base, result_loc, value); |
| 23645 | } | 23643 | } |
| 23646 | | 23644 | |
| ... | @@ -23874,6 +23872,8 @@ static IrInstruction *ir_analyze_instruction_base(IrAnalyze *ira, IrInstruction | ... | @@ -23874,6 +23872,8 @@ static IrInstruction *ir_analyze_instruction_base(IrAnalyze *ira, IrInstruction |
| 23874 | return ir_analyze_instruction_ptr_type(ira, (IrInstructionPtrType *)instruction); | 23872 | return ir_analyze_instruction_ptr_type(ira, (IrInstructionPtrType *)instruction); |
| 23875 | case IrInstructionIdAlignCast: | 23873 | case IrInstructionIdAlignCast: |
| 23876 | return ir_analyze_instruction_align_cast(ira, (IrInstructionAlignCast *)instruction); | 23874 | return ir_analyze_instruction_align_cast(ira, (IrInstructionAlignCast *)instruction); |
| | 23875 | case IrInstructionIdImplicitCast: |
| | 23876 | return ir_analyze_instruction_implicit_cast(ira, (IrInstructionImplicitCast *)instruction); |
| 23877 | case IrInstructionIdOpaqueType: | 23877 | case IrInstructionIdOpaqueType: |
| 23878 | return ir_analyze_instruction_opaque_type(ira, (IrInstructionOpaqueType *)instruction); | 23878 | return ir_analyze_instruction_opaque_type(ira, (IrInstructionOpaqueType *)instruction); |
| 23879 | case IrInstructionIdSetAlignStack: | 23879 | case IrInstructionIdSetAlignStack: |
| ... | @@ -24165,6 +24165,7 @@ bool ir_has_side_effects(IrInstruction *instruction) { | ... | @@ -24165,6 +24165,7 @@ bool ir_has_side_effects(IrInstruction *instruction) { |
| 24165 | case IrInstructionIdTypeInfo: | 24165 | case IrInstructionIdTypeInfo: |
| 24166 | case IrInstructionIdTypeId: | 24166 | case IrInstructionIdTypeId: |
| 24167 | case IrInstructionIdAlignCast: | 24167 | case IrInstructionIdAlignCast: |
| | 24168 | case IrInstructionIdImplicitCast: |
| 24168 | case IrInstructionIdOpaqueType: | 24169 | case IrInstructionIdOpaqueType: |
| 24169 | case IrInstructionIdArgType: | 24170 | case IrInstructionIdArgType: |
| 24170 | case IrInstructionIdTagType: | 24171 | case IrInstructionIdTagType: |