remove another implicit cast to const pointer
* remove implicit cast from *T to ?*const T * remove implicit cast from T to ?*const T when T is a struct/unionmaster
parent
0921a93c1c
commit
ca71373da1
13
src/ir.cpp
13
src/ir.cpp
|
@ -10517,19 +10517,6 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
|
||||||
} else {
|
} else {
|
||||||
return ira->codegen->invalid_instruction;
|
return ira->codegen->invalid_instruction;
|
||||||
}
|
}
|
||||||
} else if (wanted_child_type->id == ZigTypeIdPointer &&
|
|
||||||
wanted_child_type->data.pointer.is_const &&
|
|
||||||
(actual_type->id == ZigTypeIdPointer || is_container(actual_type)))
|
|
||||||
{
|
|
||||||
IrInstruction *cast1 = ir_analyze_cast(ira, source_instr, wanted_child_type, value);
|
|
||||||
if (type_is_invalid(cast1->value.type))
|
|
||||||
return ira->codegen->invalid_instruction;
|
|
||||||
|
|
||||||
IrInstruction *cast2 = ir_analyze_cast(ira, source_instr, wanted_type, cast1);
|
|
||||||
if (type_is_invalid(cast2->value.type))
|
|
||||||
return ira->codegen->invalid_instruction;
|
|
||||||
|
|
||||||
return cast2;
|
|
||||||
} else if (
|
} else if (
|
||||||
wanted_child_type->id == ZigTypeIdPointer &&
|
wanted_child_type->id == ZigTypeIdPointer &&
|
||||||
wanted_child_type->data.pointer.ptr_len == PtrLenUnknown &&
|
wanted_child_type->data.pointer.ptr_len == PtrLenUnknown &&
|
||||||
|
|
Loading…
Reference in New Issue