| 27 | namespace val { |
| 28 | |
| 29 | spv_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 | /// |
no test coverage detected