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

Function ValidateConstantNull

source/val/validate_constants.cpp:540–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538}
539
540spv_result_t ValidateConstantNull(ValidationState_t& _,
541 const Instruction* inst) {
542 const auto result_type = _.FindDef(inst->type_id());
543 if (!result_type || !IsTypeNullable(result_type->words(), _)) {
544 return _.diag(SPV_ERROR_INVALID_ID, inst)
545 << "OpConstantNull Result Type <id> " << _.getIdName(inst->type_id())
546 << " cannot have a null value.";
547 }
548
549 return SPV_SUCCESS;
550}
551
552spv_result_t ValidateConstantSizeOfEXT(ValidationState_t& _,
553 const Instruction* inst) {

Callers 1

ConstantPassFunction · 0.85

Calls 5

IsTypeNullableFunction · 0.85
FindDefMethod · 0.80
diagMethod · 0.80
getIdNameMethod · 0.80
type_idMethod · 0.45

Tested by

no test coverage detected