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

Method MapUnmatchedIds

source/diff/diff.cpp:589–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587};
588
589void 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
610void IdInstructions::MapIdToInstruction(uint32_t id,
611 const opt::Instruction* inst) {

Callers 1

OutputMethod · 0.80

Calls 3

IsMappedMethod · 0.80
MakeFreshIdMethod · 0.80
IdBoundMethod · 0.45

Tested by

no test coverage detected