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

Function UpdateIdUse

source/val/validate_id.cpp:29–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace val {
28
29spv_result_t UpdateIdUse(ValidationState_t& _, const Instruction* inst) {
30 for (auto& operand : inst->operands()) {
31 const spv_operand_type_t& type = operand.type;
32 const uint32_t operand_id = inst->word(operand.offset);
33 if (spvIsIdType(type) && type != SPV_OPERAND_TYPE_RESULT_ID) {
34 if (auto def = _.FindDef(operand_id))
35 def->RegisterUse(inst, operand.offset);
36 }
37 }
38
39 return SPV_SUCCESS;
40}
41
42/// This function checks all ID definitions dominate their use in the CFG.
43///

Calls 5

spvIsIdTypeFunction · 0.85
operandsMethod · 0.80
wordMethod · 0.80
FindDefMethod · 0.80
RegisterUseMethod · 0.80

Tested by

no test coverage detected