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

Function ValidateInt32Operand

source/val/validate_memory.cpp:2970–2982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2968}
2969
2970spv_result_t ValidateInt32Operand(ValidationState_t& _, const Instruction* inst,
2971 uint32_t operand_index,
2972 const char* opcode_name,
2973 const char* operand_name) {
2974 const auto type_id =
2975 _.FindDef(inst->GetOperandAs<uint32_t>(operand_index))->type_id();
2976 if (!_.IsIntScalarType(type_id, 32)) {
2977 return _.diag(SPV_ERROR_INVALID_ID, inst)
2978 << opcode_name << " " << operand_name << " type <id> "
2979 << _.getIdName(type_id) << " is not a 32 bit integer.";
2980 }
2981 return SPV_SUCCESS;
2982}
2983
2984spv_result_t ValidateInt32Or64Operand(ValidationState_t& _,
2985 const Instruction* inst,

Calls 5

FindDefMethod · 0.80
IsIntScalarTypeMethod · 0.80
diagMethod · 0.80
getIdNameMethod · 0.80
type_idMethod · 0.45

Tested by

no test coverage detected