| 119 | } |
| 120 | |
| 121 | void TransformationAddDeadContinue::Apply( |
| 122 | opt::IRContext* ir_context, |
| 123 | TransformationContext* transformation_context) const { |
| 124 | auto bb_from = ir_context->cfg()->block(message_.from_block()); |
| 125 | auto continue_block = |
| 126 | bb_from->IsLoopHeader() |
| 127 | ? bb_from->ContinueBlockId() |
| 128 | : ir_context->GetStructuredCFGAnalysis()->LoopContinueBlock( |
| 129 | message_.from_block()); |
| 130 | assert(continue_block && "message_.from_block must be in a loop."); |
| 131 | fuzzerutil::AddUnreachableEdgeAndUpdateOpPhis( |
| 132 | ir_context, bb_from, ir_context->cfg()->block(continue_block), |
| 133 | fuzzerutil::MaybeGetBoolConstant(ir_context, *transformation_context, |
| 134 | message_.continue_condition_value(), |
| 135 | false), |
| 136 | message_.phi_id()); |
| 137 | |
| 138 | // Invalidate all analyses |
| 139 | ir_context->InvalidateAnalysesExceptFor( |
| 140 | opt::IRContext::Analysis::kAnalysisNone); |
| 141 | } |
| 142 | |
| 143 | protobufs::Transformation TransformationAddDeadContinue::ToMessage() const { |
| 144 | protobufs::Transformation result; |
nothing calls this directly
no test coverage detected