void Compiler::impReimportMarkSuccessors(BasicBlock* block)
{
- for (unsigned i = 0; i < block->NumSucc(); i++)
+ const unsigned numSuccs = block->NumSucc();
+ for (unsigned i = 0; i < numSuccs; i++)
{
impReimportMarkBlock(block->GetSucc(i));
}
JITDUMP("Marking BBF_INTERNAL block BB%02u as BBF_IMPORTED\n", block->bbNum);
block->bbFlags |= BBF_IMPORTED;
- for (unsigned i = 0; i < block->NumSucc(); i++)
+ const unsigned numSuccs = block->NumSucc();
+ for (unsigned i = 0; i < numSuccs; i++)
{
impImportBlockPending(block->GetSucc(i));
}
impReimportSpillClique(block);
// For blocks that haven't been imported yet, we still need to mark them as pending import.
- for (unsigned i = 0; i < block->NumSucc(); i++)
+ const unsigned numSuccs = block->NumSucc();
+ for (unsigned i = 0; i < numSuccs; i++)
{
BasicBlock* succ = block->GetSucc(i);
if ((succ->bbFlags & BBF_IMPORTED) == 0)
// otherwise just import the successors of block
/* Does this block jump to any other blocks? */
- for (unsigned i = 0; i < block->NumSucc(); i++)
+ const unsigned numSuccs = block->NumSucc();
+ for (unsigned i = 0; i < numSuccs; i++)
{
impImportBlockPending(block->GetSucc(i));
}
BasicBlock* blk = node->m_blk;
FreeBlockListNode(node);
- for (unsigned succNum = 0; succNum < blk->NumSucc(); succNum++)
+ const unsigned numSuccs = blk->NumSucc();
+ for (unsigned succNum = 0; succNum < numSuccs; succNum++)
{
BasicBlock* succ = blk->GetSucc(succNum);
// If it's not already in the clique, add it, and also add it
assert(!"Switch with single successor");
}
- for (unsigned succIndex = 0; succIndex < block->NumSucc(compiler); succIndex++)
+ const unsigned numSuccs = block->NumSucc(compiler);
+ for (unsigned succIndex = 0; succIndex < numSuccs; succIndex++)
{
BasicBlock* succ = block->GetSucc(succIndex, compiler);
if (checkForCriticalOutEdge && succ->GetUniquePred(compiler) == nullptr)