| 942 | // `uint32_t`. |
| 943 | template <typename T> |
| 944 | void Differ::GroupIds(const IdGroup& ids, bool is_src, |
| 945 | std::map<T, IdGroup>* groups, |
| 946 | T (Differ::*get_group)(const IdInstructions&, uint32_t)) { |
| 947 | assert(groups->empty()); |
| 948 | |
| 949 | const IdInstructions& id_to = is_src ? src_id_to_ : dst_id_to_; |
| 950 | |
| 951 | for (const uint32_t id : ids) { |
| 952 | // Don't include ids that are already matched, for example through |
| 953 | // OpEntryPoint. |
| 954 | const bool is_matched = |
| 955 | is_src ? id_map_.IsSrcMapped(id) : id_map_.IsDstMapped(id); |
| 956 | if (is_matched) { |
| 957 | continue; |
| 958 | } |
| 959 | |
| 960 | T group = (this->*get_group)(id_to, id); |
| 961 | (*groups)[group].push_back(id); |
| 962 | } |
| 963 | } |
| 964 | |
| 965 | // Group `src_ids` and `dst_ids` according to `get_group`, and then use |
| 966 | // `match_group` to pair up ids in corresponding groups. |
nothing calls this directly
no test coverage detected