diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2015-12-23 14:09:22 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2016-01-05 11:36:37 +0000 |
commit | d19acb0cbb81bc270291241fd2fde4bb0869ac89 (patch) | |
tree | 4d9ca59ce8941acb70647c6aa548d49bcb141ea2 /src/qml/compiler/qv4jsir.cpp | |
parent | eea8fa64ab27854b71f46ef143e35b6c9acbba14 (diff) |
V4: use range-based for-loops in the IR.
Change-Id: I488a8700c1fc070c1cbdfd8b6d1b1e5614be8702
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/compiler/qv4jsir.cpp')
-rw-r--r-- | src/qml/compiler/qv4jsir.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp index f49a440572..a991666b28 100644 --- a/src/qml/compiler/qv4jsir.cpp +++ b/src/qml/compiler/qv4jsir.cpp @@ -164,12 +164,12 @@ struct RemoveSharedExpressions: IR::StmtVisitor, IR::ExprVisitor subexpressions.clear(); subexpressions.reserve(function->basicBlockCount() * 8); - foreach (BasicBlock *block, function->basicBlocks()) { + for (BasicBlock *block : function->basicBlocks()) { if (block->isRemoved()) continue; clone.setBasicBlock(block); - foreach (Stmt *s, block->statements()) { + for (Stmt *s : block->statements()) { s->accept(this); } } @@ -451,7 +451,7 @@ void Function::removeBasicBlock(BasicBlock *block) int Function::liveBasicBlocksCount() const { int count = 0; - foreach (BasicBlock *bb, basicBlocks()) + for (BasicBlock *bb : basicBlocks()) if (!bb->isRemoved()) ++count; return count; @@ -507,7 +507,7 @@ void Function::setStatementCount(int cnt) BasicBlock::~BasicBlock() { - foreach (Stmt *s, _statements) { + for (Stmt *s : qAsConst(_statements)) { Phi *p = s->asPhi(); if (p) p->destroyData(); @@ -764,7 +764,7 @@ void BasicBlock::setStatements(const QVector<Stmt *> &newStatements) Q_ASSERT(!isRemoved()); Q_ASSERT(newStatements.size() >= _statements.size()); // FIXME: this gets quite inefficient for large basic-blocks, so this function/case should be re-worked. - foreach (Stmt *s, _statements) { + for (Stmt *s : qAsConst(_statements)) { Phi *p = s->asPhi(); if (!p) continue; @@ -978,11 +978,11 @@ void IRPrinter::print(Function *f) *out << ')' << endl << '{' << endl; - foreach (const QString *local, f->locals) + for (const QString *local : qAsConst(f->locals)) *out << " local var " << *local << endl; bool needsSeperator = !f->locals.isEmpty(); - foreach (BasicBlock *bb, f->basicBlocks()) { + for (BasicBlock *bb : f->basicBlocks()) { if (bb->isRemoved()) continue; @@ -1000,7 +1000,7 @@ void IRPrinter::print(BasicBlock *bb) std::swap(currentBB, bb); printBlockStart(); - foreach (Stmt *s, currentBB->statements()) { + for (Stmt *s : currentBB->statements()) { if (!s) continue; @@ -1315,7 +1315,7 @@ void IRPrinter::printBlockStart() *out << str; *out << "; predecessors:"; - foreach (BasicBlock *in, currentBB->in) + for (BasicBlock *in : qAsConst(currentBB->in)) *out << " L" << in->index(); if (currentBB->in.isEmpty()) *out << " none"; |