| ... | ... | @@ -3509,9 +3509,23 @@ pub fn mapOldZirToNew( |
| 3509 | 3509 | for ( |
| 3510 | 3510 | old_contents.other.items[0..num_other], |
| 3511 | 3511 | new_contents.other.items[0..num_other], |
| 3512 | | ) |old_inst, new_inst| { |
| 3512 | ) |old_inst_index, new_inst_index| { |
| 3513 | 3513 | // These instructions don't have declarations, so we just modify `inst_map` directly. |
| 3514 | | inst_map.putAssumeCapacity(old_inst, new_inst); |
| 3514 | |
| 3515 | // But first: a mapping must not change an instruction's tag, so ignore any |
| 3516 | // candidates which would. |
| 3517 | const old_inst = old_zir.instructions.get(@backingInt(old_inst_index)); |
| 3518 | const new_inst = new_zir.instructions.get(@backingInt(new_inst_index)); |
| 3519 | if (old_inst.tag != new_inst.tag) { |
| 3520 | continue; |
| 3521 | } |
| 3522 | if (old_inst.tag == .extended and |
| 3523 | old_inst.data.extended.opcode != new_inst.data.extended.opcode) |
| 3524 | { |
| 3525 | continue; |
| 3526 | } |
| 3527 | |
| 3528 | inst_map.putAssumeCapacity(old_inst_index, new_inst_index); |
| 3515 | 3529 | } |
| 3516 | 3530 | } |
| 3517 | 3531 | |
| ... | ... | @@ -3602,9 +3616,23 @@ pub fn mapOldZirToNew( |
| 3602 | 3616 | for ( |
| 3603 | 3617 | old_contents.other.items[0..num_other], |
| 3604 | 3618 | new_contents.other.items[0..num_other], |
| 3605 | | ) |old_inst, new_inst| { |
| 3619 | ) |old_inst_index, new_inst_index| { |
| 3606 | 3620 | // These instructions don't have declarations, so we just modify `inst_map` directly. |
| 3607 | | inst_map.putAssumeCapacity(old_inst, new_inst); |
| 3621 | |
| 3622 | // But first: a mapping must not change an instruction's tag, so ignore any |
| 3623 | // candidates which would. |
| 3624 | const old_inst = old_zir.instructions.get(@backingInt(old_inst_index)); |
| 3625 | const new_inst = new_zir.instructions.get(@backingInt(new_inst_index)); |
| 3626 | if (old_inst.tag != new_inst.tag) { |
| 3627 | continue; |
| 3628 | } |
| 3629 | if (old_inst.tag == .extended and |
| 3630 | old_inst.data.extended.opcode != new_inst.data.extended.opcode) |
| 3631 | { |
| 3632 | continue; |
| 3633 | } |
| 3634 | |
| 3635 | inst_map.putAssumeCapacity(old_inst_index, new_inst_index); |
| 3608 | 3636 | } |
| 3609 | 3637 | |
| 3610 | 3638 | if (old_contents.func_decl) |old_func_inst| { |