| 587 | }; |
| 588 | |
| 589 | void SrcDstIdMap::MapUnmatchedIds( |
| 590 | std::function<bool(uint32_t)> src_insn_defined, |
| 591 | std::function<bool(uint32_t)> dst_insn_defined) { |
| 592 | const uint32_t src_id_bound = static_cast<uint32_t>(src_to_dst_.IdBound()); |
| 593 | const uint32_t dst_id_bound = static_cast<uint32_t>(dst_to_src_.IdBound()); |
| 594 | |
| 595 | for (uint32_t src_id = 1; src_id < src_id_bound; ++src_id) { |
| 596 | if (!src_to_dst_.IsMapped(src_id) && src_insn_defined(src_id)) { |
| 597 | uint32_t fresh_dst_id = dst_to_src_.MakeFreshId(); |
| 598 | MapIds(src_id, fresh_dst_id); |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | for (uint32_t dst_id = 1; dst_id < dst_id_bound; ++dst_id) { |
| 603 | if (!dst_to_src_.IsMapped(dst_id) && dst_insn_defined(dst_id)) { |
| 604 | uint32_t fresh_src_id = src_to_dst_.MakeFreshId(); |
| 605 | MapIds(fresh_src_id, dst_id); |
| 606 | } |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | void IdInstructions::MapIdToInstruction(uint32_t id, |
| 611 | const opt::Instruction* inst) { |
no test coverage detected