| 677 | } |
| 678 | |
| 679 | void Differ::PoolPotentialIds( |
| 680 | opt::IteratorRange<opt::Module::const_inst_iterator> section, |
| 681 | std::vector<uint32_t>& ids, bool is_src, |
| 682 | std::function<bool(const opt::Instruction&)> filter, |
| 683 | std::function<uint32_t(const opt::Instruction&)> get_id) { |
| 684 | for (const opt::Instruction& inst : section) { |
| 685 | if (!filter(inst)) { |
| 686 | continue; |
| 687 | } |
| 688 | |
| 689 | uint32_t result_id = get_id(inst); |
| 690 | assert(result_id != 0); |
| 691 | |
| 692 | assert(std::find(ids.begin(), ids.end(), result_id) == ids.end()); |
| 693 | |
| 694 | // Don't include ids that are already matched, for example through |
| 695 | // OpTypeForwardPointer. |
| 696 | const bool is_matched = is_src ? id_map_.IsSrcMapped(result_id) |
| 697 | : id_map_.IsDstMapped(result_id); |
| 698 | if (is_matched) { |
| 699 | continue; |
| 700 | } |
| 701 | |
| 702 | ids.push_back(result_id); |
| 703 | } |
| 704 | } |
| 705 | |
| 706 | void Differ::MatchIds( |
| 707 | PotentialIdMap& potential, |
nothing calls this directly
no test coverage detected