Avoids heap allocations, drops around ~60ms off my morbid testcase in doing so.
QBitArray is still allocating, meaning this function isn't "free", but it's now
at 0.9% of runtime vs the 1.3% it was before, so something for another day.
Change-Id: Ie0db8e0312bde5f67b37250d04b4d65e1f0b034d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
// reachable through outgoing edges, starting with the start block and all exception handler
// blocks.
QBitArray reachableBlocks(function->basicBlockCount());
- QVector<BasicBlock *> postponed;
- postponed.reserve(16);
+ QVarLengthArray<BasicBlock *, 16> postponed;
for (int i = 0, ei = function->basicBlockCount(); i != ei; ++i) {
BasicBlock *bb = function->basicBlock(i);
if (i == 0 || bb->isExceptionHandler())