| 291 | } |
| 292 | |
| 293 | void Loop::SetLatchBlock(BasicBlock* latch) { |
| 294 | #ifndef NDEBUG |
| 295 | assert(latch->GetParent() && "The basic block does not belong to a function"); |
| 296 | |
| 297 | const auto* const_latch = latch; |
| 298 | const_latch->ForEachSuccessorLabel([this](uint32_t id) { |
| 299 | assert((!IsInsideLoop(id) || id == GetHeaderBlock()->id()) && |
| 300 | "A predecessor of the continue block does not belong to the loop"); |
| 301 | }); |
| 302 | #endif // NDEBUG |
| 303 | assert(IsInsideLoop(latch) && "The continue block is not in the loop"); |
| 304 | |
| 305 | SetLatchBlockImpl(latch); |
| 306 | } |
| 307 | |
| 308 | void Loop::SetMergeBlock(BasicBlock* merge) { |
| 309 | #ifndef NDEBUG |
no test coverage detected