mirror of https://github.com/YosysHQ/yosys.git
Simplify some RTLIL destructors
No change in behaviour, but use range-based for loops instead of iterators.
This commit is contained in:
parent
801ecc0e1d
commit
081111714e
|
@ -571,8 +571,8 @@ RTLIL::Design::Design()
|
||||||
|
|
||||||
RTLIL::Design::~Design()
|
RTLIL::Design::~Design()
|
||||||
{
|
{
|
||||||
for (auto it = modules_.begin(); it != modules_.end(); ++it)
|
for (auto &pr : modules_)
|
||||||
delete it->second;
|
delete pr.second;
|
||||||
for (auto n : verilog_packages)
|
for (auto n : verilog_packages)
|
||||||
delete n;
|
delete n;
|
||||||
for (auto n : verilog_globals)
|
for (auto n : verilog_globals)
|
||||||
|
@ -864,14 +864,14 @@ RTLIL::Module::Module()
|
||||||
|
|
||||||
RTLIL::Module::~Module()
|
RTLIL::Module::~Module()
|
||||||
{
|
{
|
||||||
for (auto it = wires_.begin(); it != wires_.end(); ++it)
|
for (auto &pr : wires_)
|
||||||
delete it->second;
|
delete pr.second;
|
||||||
for (auto it = memories.begin(); it != memories.end(); ++it)
|
for (auto &pr : memories)
|
||||||
delete it->second;
|
delete pr.second;
|
||||||
for (auto it = cells_.begin(); it != cells_.end(); ++it)
|
for (auto &pr : cells_)
|
||||||
delete it->second;
|
delete pr.second;
|
||||||
for (auto it = processes.begin(); it != processes.end(); ++it)
|
for (auto &pr : processes)
|
||||||
delete it->second;
|
delete pr.second;
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
RTLIL::Module::get_all_modules()->erase(hashidx_);
|
RTLIL::Module::get_all_modules()->erase(hashidx_);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue