MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / PoolPotentialIds

Method PoolPotentialIds

source/diff/diff.cpp:679–704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677}
678
679void 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
706void Differ::MatchIds(
707 PotentialIdMap& potential,

Callers

nothing calls this directly

Calls 6

findFunction · 0.85
IsSrcMappedMethod · 0.80
IsDstMappedMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected