diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2015-01-11 21:11:29 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-01-23 13:29:57 +0100 |
commit | 43fe684d42d90dd76d7d6c946a37ec0002f703a8 (patch) | |
tree | a6b06bc39509ae9b051d11420bb7177f495e6e4a /src/qml/compiler/qv4jsir.cpp | |
parent | fc2da305171eb913eb5f3acdbe4ebd39cca2d1ac (diff) |
Move Stmt::d to Phi::d
Phi is the only thing using it.
Change-Id: I2b6706884d9e41cc26632a6ad72281b391960f4f
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/qml/compiler/qv4jsir.cpp')
-rw-r--r-- | src/qml/compiler/qv4jsir.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp index fbfcf31aa0..13ed3944b8 100644 --- a/src/qml/compiler/qv4jsir.cpp +++ b/src/qml/compiler/qv4jsir.cpp @@ -511,8 +511,11 @@ void Function::setStatementCount(int cnt) BasicBlock::~BasicBlock() { - foreach (Stmt *s, _statements) - s->destroyData(); + foreach (Stmt *s, _statements) { + Phi *p = s->asPhi(); + if (p) + p->destroyData(); + } } unsigned BasicBlock::newTemp() @@ -766,8 +769,12 @@ void BasicBlock::setStatements(const QVector<Stmt *> &newStatements) 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) { - if (!newStatements.contains(s)) - s->destroyData(); + Phi *p = s->asPhi(); + if (!p) + continue; + + if (!newStatements.contains(p)) + p->destroyData(); } _statements = newStatements; } @@ -816,21 +823,27 @@ void BasicBlock::insertStatementBeforeTerminator(Stmt *stmt) void BasicBlock::replaceStatement(int index, Stmt *newStmt) { Q_ASSERT(!isRemoved()); - _statements[index]->destroyData(); + Phi *p = _statements[index]->asPhi(); + if (p) + p->destroyData(); _statements[index] = newStmt; } void BasicBlock::removeStatement(Stmt *stmt) { Q_ASSERT(!isRemoved()); - stmt->destroyData(); + Phi *p = stmt->asPhi(); + if (p) + p->destroyData(); _statements.remove(_statements.indexOf(stmt)); } void BasicBlock::removeStatement(int idx) { Q_ASSERT(!isRemoved()); - _statements[idx]->destroyData(); + Phi *p = _statements[idx]->asPhi(); + if (p) + p->destroyData(); _statements.remove(idx); } |