if (callback.EndMerge(block))
{
- AllSuccessorIter succsBegin = block->GetAllSuccs(m_pCompiler).begin();
- AllSuccessorIter succsEnd = block->GetAllSuccs(m_pCompiler).end();
- for (AllSuccessorIter succ = succsBegin; succ != succsEnd; ++succ)
+ for (BasicBlock* succ : block->GetAllSuccs(m_pCompiler))
{
- worklist.insert(worklist.end(), *succ);
+ worklist.insert(worklist.end(), succ);
}
}
}
{
BitVecOps::AddElemD(&blockVecTraits, blocksSeen, block->bbNum);
- AllSuccessorIter succsEnd = block->GetAllSuccs(this).end();
- for (AllSuccessorIter succs = block->GetAllSuccs(this).begin(); succs != succsEnd; ++succs)
+ for (BasicBlock* succ : block->GetAllSuccs(this))
{
- BasicBlock* succ = (*succs);
if (BitVecOps::IsMember(&blockVecTraits, blocksSeen, succ->bbNum))
{
return true;
}
// Additionally, union in all the live-in tracked vars of successors.
- AllSuccessorIter succsEnd = block->GetAllSuccs(m_compiler).end();
- for (AllSuccessorIter succs = block->GetAllSuccs(m_compiler).begin(); succs != succsEnd; ++succs)
+ for (BasicBlock* succ : block->GetAllSuccs(m_compiler))
{
- BasicBlock* succ = (*succs);
VarSetOps::UnionD(m_compiler, m_liveOut, succ->bbLiveIn);
- m_memoryLiveOut |= (*succs)->bbMemoryLiveIn;
+ m_memoryLiveOut |= succ->bbMemoryLiveIn;
if (succ->bbNum <= block->bbNum)
{
m_hasPossibleBackEdge = true;
{
VarSetOps::DiffD(compiler, expUseSet, nextBlock->bbLiveIn);
}
- AllSuccessorIter succsEnd = block->GetAllSuccs(compiler).end();
- for (AllSuccessorIter succs = block->GetAllSuccs(compiler).begin();
- succs != succsEnd && !VarSetOps::IsEmpty(compiler, expUseSet); ++succs)
+ for (BasicBlock* succ : block->GetAllSuccs(compiler))
{
- BasicBlock* succ = (*succs);
+ if (VarSetOps::IsEmpty(compiler, expUseSet))
+ break;
+
if (isBlockVisited(succ))
{
continue;
*/
void SsaBuilder::AssignPhiNodeRhsVariables(BasicBlock* block, SsaRenameState* pRenameState)
{
- BasicBlock::AllSuccs allSuccs = block->GetAllSuccs(m_pCompiler);
- AllSuccessorIter allSuccsEnd = allSuccs.end();
- for (AllSuccessorIter allSuccsIter = allSuccs.begin(); allSuccsIter != allSuccsEnd; ++allSuccsIter)
+ for (BasicBlock* succ : block->GetAllSuccs(m_pCompiler))
{
- BasicBlock* succ = (*allSuccsIter);
// Walk the statements for phi nodes.
for (GenTreePtr stmt = succ->bbTreeList; stmt != nullptr && stmt->IsPhiDefnStmt(); stmt = stmt->gtNext)
{
SetVisitBit(blk->bbNum, BVB_complete);
- AllSuccessorIter succsEnd = blk->GetAllSuccs(m_comp).end();
- for (AllSuccessorIter succs = blk->GetAllSuccs(m_comp).begin(); succs != succsEnd; ++succs)
+ for (BasicBlock* succ : blk->GetAllSuccs(m_comp))
{
- BasicBlock* succ = (*succs);
#ifdef DEBUG_VN_VISIT
JITDUMP(" Succ(BB%02u).\n", succ->bbNum);
#endif // DEBUG_VN_VISIT