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

Function ValidateConstantBool

source/val/validate_constants.cpp:24–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace {
23
24spv_result_t ValidateConstantBool(ValidationState_t& _,
25 const Instruction* inst) {
26 auto type = _.FindDef(inst->type_id());
27 if (!type || type->opcode() != spv::Op::OpTypeBool) {
28 return _.diag(SPV_ERROR_INVALID_ID, inst)
29 << "Op" << spvOpcodeString(inst->opcode()) << " Result Type <id> "
30 << _.getIdName(inst->type_id()) << " is not a boolean type.";
31 }
32
33 return SPV_SUCCESS;
34}
35
36bool isCompositeType(const Instruction* inst) {
37 bool is_tensor = inst->opcode() == spv::Op::OpTypeTensorARM;

Callers 1

ConstantPassFunction · 0.85

Calls 6

spvOpcodeStringFunction · 0.85
FindDefMethod · 0.80
diagMethod · 0.80
getIdNameMethod · 0.80
type_idMethod · 0.45
opcodeMethod · 0.45

Tested by

no test coverage detected