zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 67fbb0434f7104801c66e821b5057a8323e377df (tree)
parent ef5d7ce46382fb2735e83958fe1bbe416624906a
Author: Andrew Kelley <superjoe30@gmail.com>
Date:   Sun, 11 Nov 2018 12:48:55 -0500

ir: remove redundant casting code

Diffstat:
Msrc/ir.cpp | 19-------------------
1 file changed, 0 insertions(+), 19 deletions(-)

diff --git a/src/ir.cpp b/src/ir.cpp @@ -10421,25 +10421,6 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst } } - // cast from *const [N]T to []const T - if (is_slice(wanted_type) && - actual_type->id == ZigTypeIdPointer && - actual_type->data.pointer.is_const && - actual_type->data.pointer.child_type->id == ZigTypeIdArray) - { - ZigType *ptr_type = wanted_type->data.structure.fields[slice_ptr_index].type_entry; - assert(ptr_type->id == ZigTypeIdPointer); - - ZigType *array_type = actual_type->data.pointer.child_type; - - if ((ptr_type->data.pointer.is_const || array_type->data.array.len == 0) && - types_match_const_cast_only(ira, ptr_type->data.pointer.child_type, array_type->data.array.child_type, - source_node, false).id == ConstCastResultIdOk) - { - return ir_analyze_array_to_slice(ira, source_instr, value, wanted_type); - } - } - // cast from [N]T to ?[]const T if (wanted_type->id == ZigTypeIdOptional && is_slice(wanted_type->data.maybe.child_type) &&