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

Method ToMappedSrcIds

source/diff/diff.cpp:2780–2796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2778}
2779
2780opt::Instruction Differ::ToMappedSrcIds(const opt::Instruction& dst_inst) {
2781 // Create an identical instruction to dst_inst, except ids are changed to the
2782 // mapped one.
2783 opt::Instruction mapped_inst = dst_inst;
2784
2785 for (uint32_t operand_index = 0; operand_index < mapped_inst.NumOperands();
2786 ++operand_index) {
2787 opt::Operand& operand = mapped_inst.GetOperand(operand_index);
2788
2789 if (spvIsIdType(operand.type)) {
2790 assert(id_map_.IsDstMapped(operand.AsId()));
2791 operand.words[0] = id_map_.MappedSrcId(operand.AsId());
2792 }
2793 }
2794
2795 return mapped_inst;
2796}
2797
2798spv_result_t Differ::Output() {
2799 id_map_.MapUnmatchedIds(

Callers

nothing calls this directly

Calls 5

spvIsIdTypeFunction · 0.85
NumOperandsMethod · 0.80
IsDstMappedMethod · 0.80
AsIdMethod · 0.80
MappedSrcIdMethod · 0.80

Tested by

no test coverage detected