| ... | @@ -13535,16 +13535,6 @@ static IrInstruction *ir_analyze_instruction_return(IrAnalyze *ira, IrInstructio | ... | @@ -13535,16 +13535,6 @@ static IrInstruction *ir_analyze_instruction_return(IrAnalyze *ira, IrInstructio |
| 13535 | if (type_is_invalid(operand->value.type)) | 13535 | if (type_is_invalid(operand->value.type)) |
| 13536 | return ir_unreach_error(ira); | 13536 | return ir_unreach_error(ira); |
| 13537 | | 13537 | |
| 13538 | if (!instr_is_comptime(operand) && ira->explicit_return_type != nullptr && | | |
| 13539 | handle_is_ptr(ira->explicit_return_type)) | | |
| 13540 | { | | |
| 13541 | // result location mechanism took care of it. | | |
| 13542 | IrInstruction *result = ir_build_return(&ira->new_irb, instruction->base.scope, | | |
| 13543 | instruction->base.source_node, nullptr); | | |
| 13544 | result->value.type = ira->codegen->builtin_types.entry_unreachable; | | |
| 13545 | return ir_finish_anal(ira, result); | | |
| 13546 | } | | |
| 13547 | | | |
| 13548 | IrInstruction *casted_operand = ir_implicit_cast(ira, operand, ira->explicit_return_type); | 13538 | IrInstruction *casted_operand = ir_implicit_cast(ira, operand, ira->explicit_return_type); |
| 13549 | if (type_is_invalid(casted_operand->value.type)) { | 13539 | if (type_is_invalid(casted_operand->value.type)) { |
| 13550 | AstNode *source_node = ira->explicit_return_type_source_node; | 13540 | AstNode *source_node = ira->explicit_return_type_source_node; |
| ... | @@ -13556,6 +13546,16 @@ static IrInstruction *ir_analyze_instruction_return(IrAnalyze *ira, IrInstructio | ... | @@ -13556,6 +13546,16 @@ static IrInstruction *ir_analyze_instruction_return(IrAnalyze *ira, IrInstructio |
| 13556 | return ir_unreach_error(ira); | 13546 | return ir_unreach_error(ira); |
| 13557 | } | 13547 | } |
| 13558 | | 13548 | |
| | 13549 | if (!instr_is_comptime(operand) && ira->explicit_return_type != nullptr && |
| | 13550 | handle_is_ptr(ira->explicit_return_type)) |
| | 13551 | { |
| | 13552 | // result location mechanism took care of it. |
| | 13553 | IrInstruction *result = ir_build_return(&ira->new_irb, instruction->base.scope, |
| | 13554 | instruction->base.source_node, nullptr); |
| | 13555 | result->value.type = ira->codegen->builtin_types.entry_unreachable; |
| | 13556 | return ir_finish_anal(ira, result); |
| | 13557 | } |
| | 13558 | |
| 13559 | if (casted_operand->value.special == ConstValSpecialRuntime && | 13559 | if (casted_operand->value.special == ConstValSpecialRuntime && |
| 13560 | casted_operand->value.type->id == ZigTypeIdPointer && | 13560 | casted_operand->value.type->id == ZigTypeIdPointer && |
| 13561 | casted_operand->value.data.rh_ptr == RuntimeHintPtrStack) | 13561 | casted_operand->value.data.rh_ptr == RuntimeHintPtrStack) |