if (node->hasMultipleOutputs() && allSelectsUnused(node)) {
auto uses = node->uses(); // A copy so we don't modify it within a range loop
for (auto & use : uses)
use.user->destroy();
it.destroyCurrent();
} else if (node->uses().size() == 0) {
it.destroyCurrent();
}
This is generally useful functionality and should be put in. Would seriously consider having destroyCurrent() learn this, but I also want to avoid putting too much node specific knowledge in the graph iterator (c.f. #229)
Quote from DCE:
This is generally useful functionality and should be put in. Would seriously consider having destroyCurrent() learn this, but I also want to avoid putting too much node specific knowledge in the graph iterator (c.f. #229)