/// from the specified block.
void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) {
++NumBlocks;
- unsigned NumInstsInThisBB = 0;
+ unsigned NumInstsBeforeThisBB = NumInsts;
for (BasicBlock::const_iterator II = BB->begin(), E = BB->end();
II != E; ++II) {
if (isa<PHINode>(II)) continue; // PHI nodes don't count.
}
++NumInsts;
- ++NumInstsInThisBB;
}
if (isa<ReturnInst>(BB->getTerminator()))
NeverInline = true;
// Remember NumInsts for this BB.
- NumBBInsts[BB] = NumInstsInThisBB;
+ NumBBInsts[BB] = NumInsts - NumInstsBeforeThisBB;
}
/// analyzeFunction - Fill in the current structure with information gleaned