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

Method FindOrCreateGlobalUndef

source/fuzz/fuzzer_pass.cpp:434–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434uint32_t FuzzerPass::FindOrCreateGlobalUndef(uint32_t type_id) {
435 for (auto& inst : GetIRContext()->types_values()) {
436 if (inst.opcode() == spv::Op::OpUndef && inst.type_id() == type_id) {
437 return inst.result_id();
438 }
439 }
440 auto result = GetFuzzerContext()->GetFreshId();
441 ApplyTransformation(TransformationAddGlobalUndef(result, type_id));
442 return result;
443}
444
445uint32_t FuzzerPass::FindOrCreateNullConstant(uint32_t type_id) {
446 // Find existing declaration

Callers 1

Calls 6

GetFreshIdMethod · 0.80
types_valuesMethod · 0.45
opcodeMethod · 0.45
type_idMethod · 0.45
result_idMethod · 0.45

Tested by

no test coverage detected