{
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) {
+ if (!newStatements.contains(s))
+ s->destroyData();
+ }
_statements = newStatements;
}
void BasicBlock::replaceStatement(int index, Stmt *newStmt)
{
Q_ASSERT(!isRemoved());
+ _statements[index]->destroyData();
_statements[index] = newStmt;
}
void BasicBlock::removeStatement(Stmt *stmt)
{
Q_ASSERT(!isRemoved());
+ stmt->destroyData();
_statements.remove(_statements.indexOf(stmt));
}
void BasicBlock::removeStatement(int idx)
{
Q_ASSERT(!isRemoved());
+ _statements[idx]->destroyData();
_statements.remove(idx);
}