| 2778 | } |
| 2779 | |
| 2780 | opt::Instruction Differ::ToMappedSrcIds(const opt::Instruction& dst_inst) { |
| 2781 | // Create an identical instruction to dst_inst, except ids are changed to the |
| 2782 | // mapped one. |
| 2783 | opt::Instruction mapped_inst = dst_inst; |
| 2784 | |
| 2785 | for (uint32_t operand_index = 0; operand_index < mapped_inst.NumOperands(); |
| 2786 | ++operand_index) { |
| 2787 | opt::Operand& operand = mapped_inst.GetOperand(operand_index); |
| 2788 | |
| 2789 | if (spvIsIdType(operand.type)) { |
| 2790 | assert(id_map_.IsDstMapped(operand.AsId())); |
| 2791 | operand.words[0] = id_map_.MappedSrcId(operand.AsId()); |
| 2792 | } |
| 2793 | } |
| 2794 | |
| 2795 | return mapped_inst; |
| 2796 | } |
| 2797 | |
| 2798 | spv_result_t Differ::Output() { |
| 2799 | id_map_.MapUnmatchedIds( |
nothing calls this directly
no test coverage detected