diff options
-rw-r--r-- | passes/techmap/techmap.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc index a915f207d..6b0957ad7 100644 --- a/passes/techmap/techmap.cc +++ b/passes/techmap/techmap.cc @@ -1423,14 +1423,11 @@ struct FlattenPass : public Pass { new_used_modules.insert(cell->type); } - std::set<RTLIL::Module *> to_remove; - for (auto mod : design->modules()) + for (auto mod : design->modules().to_vector()) if (!used_modules[mod->name] && !mod->get_blackbox_attribute(worker.ignore_wb)) { log("Deleting now unused module %s.\n", log_id(mod)); - to_remove.insert(mod); + design->remove(mod); } - for (auto mod : to_remove) - design->remove(mod); } log_pop(); |