| 599 | } |
| 600 | |
| 601 | void 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 | |
| 619 | opt::BasicBlock* FuzzerPass::GetOrCreateSimpleLoopPreheader( |
| 620 | uint32_t header_id) { |
nothing calls this directly
no test coverage detected