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

Function GetArraySize

source/fuzz/fuzzer_util.cpp:425–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425uint32_t GetArraySize(const opt::Instruction& array_type_instruction,
426 opt::IRContext* context) {
427 auto array_length_constant =
428 context->get_constant_mgr()
429 ->GetConstantFromInst(context->get_def_use_mgr()->GetDef(
430 array_type_instruction.GetSingleWordInOperand(1)))
431 ->AsIntConstant();
432 if (array_length_constant->words().size() != 1) {
433 return 0;
434 }
435 return array_length_constant->GetU32();
436}
437
438uint32_t GetBoundForCompositeIndex(const opt::Instruction& composite_type_inst,
439 opt::IRContext* ir_context) {

Callers 9

ApplyMethod · 0.85
ApplyMethod · 0.85
MaybeGetZeroConstantFunction · 0.85
IsApplicableMethod · 0.85
ComputeClosureOfFactsMethod · 0.85

Calls 8

GetConstantFromInstMethod · 0.80
get_constant_mgrMethod · 0.80
GetU32Method · 0.80
AsIntConstantMethod · 0.45
GetDefMethod · 0.45
get_def_use_mgrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected