@@ -585,10 +585,6 @@ static constexpr IrInstructionId ir_instruction_id(IrInstructionTypeName *) {
585585 return IrInstructionIdTypeName;
586586}
587587
588- static constexpr IrInstructionId ir_instruction_id(IrInstructionCanImplicitCast *) {
589- return IrInstructionIdCanImplicitCast;
590- }
591-
592588static constexpr IrInstructionId ir_instruction_id(IrInstructionDeclRef *) {
593589 return IrInstructionIdDeclRef;
594590}
@@ -2348,20 +2344,6 @@ static IrInstruction *ir_build_type_name(IrBuilder *irb, Scope *scope, AstNode *
23482344 return &instruction->base;
23492345}
23502346
2351- static IrInstruction *ir_build_can_implicit_cast(IrBuilder *irb, Scope *scope, AstNode *source_node,
2352- IrInstruction *type_value, IrInstruction *target_value)
2353- {
2354- IrInstructionCanImplicitCast *instruction = ir_build_instruction<IrInstructionCanImplicitCast>(
2355- irb, scope, source_node);
2356- instruction->type_value = type_value;
2357- instruction->target_value = target_value;
2358-
2359- ir_ref_instruction(type_value, irb->current_basic_block);
2360- ir_ref_instruction(target_value, irb->current_basic_block);
2361-
2362- return &instruction->base;
2363- }
2364-
23652347static IrInstruction *ir_build_decl_ref(IrBuilder *irb, Scope *scope, AstNode *source_node,
23662348 Tld *tld, LVal lval)
23672349{
@@ -4132,21 +4114,6 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo
41324114 IrInstruction *type_name = ir_build_type_name(irb, scope, node, arg0_value);
41334115 return ir_lval_wrap(irb, scope, type_name, lval);
41344116 }
4135- case BuiltinFnIdCanImplicitCast:
4136- {
4137- AstNode *arg0_node = node->data.fn_call_expr.params.at(0);
4138- IrInstruction *arg0_value = ir_gen_node(irb, arg0_node, scope);
4139- if (arg0_value == irb->codegen->invalid_instruction)
4140- return arg0_value;
4141-
4142- AstNode *arg1_node = node->data.fn_call_expr.params.at(1);
4143- IrInstruction *arg1_value = ir_gen_node(irb, arg1_node, scope);
4144- if (arg1_value == irb->codegen->invalid_instruction)
4145- return arg1_value;
4146-
4147- IrInstruction *can_implicit_cast = ir_build_can_implicit_cast(irb, scope, node, arg0_value, arg1_value);
4148- return ir_lval_wrap(irb, scope, can_implicit_cast, lval);
4149- }
41504117 case BuiltinFnIdPanic:
41514118 {
41524119 AstNode *arg0_node = node->data.fn_call_expr.params.at(0);
@@ -18405,30 +18372,6 @@ static TypeTableEntry *ir_analyze_instruction_check_statement_is_void(IrAnalyze
1840518372 return ira->codegen->builtin_types.entry_void;
1840618373}
1840718374
18408- static TypeTableEntry *ir_analyze_instruction_can_implicit_cast(IrAnalyze *ira,
18409- IrInstructionCanImplicitCast *instruction)
18410- {
18411- IrInstruction *type_value = instruction->type_value->other;
18412- TypeTableEntry *type_entry = ir_resolve_type(ira, type_value);
18413- if (type_is_invalid(type_entry))
18414- return ira->codegen->builtin_types.entry_invalid;
18415-
18416- IrInstruction *target_value = instruction->target_value->other;
18417- if (type_is_invalid(target_value->value.type))
18418- return ira->codegen->builtin_types.entry_invalid;
18419-
18420- ImplicitCastMatchResult result = ir_types_match_with_implicit_cast(ira, type_entry, target_value->value.type,
18421- target_value);
18422-
18423- if (result == ImplicitCastMatchResultReportedError) {
18424- zig_panic("TODO refactor implicit cast tester to return bool without reporting errors");
18425- }
18426-
18427- ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base);
18428- out_val->data.x_bool = (result == ImplicitCastMatchResultYes);
18429- return ira->codegen->builtin_types.entry_bool;
18430- }
18431-
1843218375static TypeTableEntry *ir_analyze_instruction_panic(IrAnalyze *ira, IrInstructionPanic *instruction) {
1843318376 IrInstruction *msg = instruction->msg->other;
1843418377 if (type_is_invalid(msg->value.type))
@@ -19762,8 +19705,6 @@ static TypeTableEntry *ir_analyze_instruction_nocast(IrAnalyze *ira, IrInstructi
1976219705 return ir_analyze_instruction_check_switch_prongs(ira, (IrInstructionCheckSwitchProngs *)instruction);
1976319706 case IrInstructionIdCheckStatementIsVoid:
1976419707 return ir_analyze_instruction_check_statement_is_void(ira, (IrInstructionCheckStatementIsVoid *)instruction);
19765- case IrInstructionIdCanImplicitCast:
19766- return ir_analyze_instruction_can_implicit_cast(ira, (IrInstructionCanImplicitCast *)instruction);
1976719708 case IrInstructionIdDeclRef:
1976819709 return ir_analyze_instruction_decl_ref(ira, (IrInstructionDeclRef *)instruction);
1976919710 case IrInstructionIdPanic:
@@ -20043,7 +19984,6 @@ bool ir_has_side_effects(IrInstruction *instruction) {
2004319984 case IrInstructionIdIntToEnum:
2004419985 case IrInstructionIdIntToErr:
2004519986 case IrInstructionIdErrToInt:
20046- case IrInstructionIdCanImplicitCast:
2004719987 case IrInstructionIdDeclRef:
2004819988 case IrInstructionIdErrName:
2004919989 case IrInstructionIdTypeName:
0 commit comments