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

Method MaybeAddUseToReplace

source/fuzz/fuzzer_pass.cpp:601–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599}
600
601void FuzzerPass::MaybeAddUseToReplace(
602 opt::Instruction* use_inst, uint32_t use_index, uint32_t replacement_id,
603 std::vector<std::pair<protobufs::IdUseDescriptor, uint32_t>>*
604 uses_to_replace) {
605 // Only consider this use if it is in a block
606 if (!GetIRContext()->get_instr_block(use_inst)) {
607 return;
608 }
609
610 // Get the index of the operand restricted to input operands.
611 uint32_t in_operand_index =
612 fuzzerutil::InOperandIndexFromOperandIndex(*use_inst, use_index);
613 auto id_use_descriptor =
614 MakeIdUseDescriptorFromUse(GetIRContext(), use_inst, in_operand_index);
615 uses_to_replace->emplace_back(
616 std::make_pair(id_use_descriptor, replacement_id));
617}
618
619opt::BasicBlock* FuzzerPass::GetOrCreateSimpleLoopPreheader(
620 uint32_t header_id) {

Callers

nothing calls this directly

Calls 4

get_instr_blockMethod · 0.80
emplace_backMethod · 0.80

Tested by

no test coverage detected