aboutsummaryrefslogtreecommitdiffstats
path: root/passes/cmds/bugpoint.cc
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-04-06 10:13:06 +0000
committerGitHub <noreply@github.com>2020-04-06 10:13:06 +0000
commitdf69febb1e8293d9234e1dc3b6be874cbb44fe3e (patch)
tree87b08b36de6081ea36c667e749ee2be4a5cb9fab /passes/cmds/bugpoint.cc
parentd61a6b81fcbc90dba81e136e0de65904f73a859e (diff)
parentfdeeb48e6225c61832de7ff6f33bf5c65050dfea (diff)
downloadyosys-df69febb1e8293d9234e1dc3b6be874cbb44fe3e.tar.gz
yosys-df69febb1e8293d9234e1dc3b6be874cbb44fe3e.tar.bz2
yosys-df69febb1e8293d9234e1dc3b6be874cbb44fe3e.zip
Merge pull request #1873 from boqwxp/cleanup_bugpoint
Clean up private member usage in `passes/cmds/bugpoint.cc`.
Diffstat (limited to 'passes/cmds/bugpoint.cc')
-rw-r--r--passes/cmds/bugpoint.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/passes/cmds/bugpoint.cc b/passes/cmds/bugpoint.cc
index ed427693d..ad6a07fa0 100644
--- a/passes/cmds/bugpoint.cc
+++ b/passes/cmds/bugpoint.cc
@@ -114,8 +114,8 @@ struct BugpointPass : public Pass {
return design;
RTLIL::Design *design_copy = new RTLIL::Design;
- for (auto &it : design->modules_)
- design_copy->add(it.second->clone());
+ for (auto module : design->modules())
+ design_copy->add(module->clone());
Pass::call(design_copy, "proc_clean -quiet");
Pass::call(design_copy, "clean -purge");
@@ -127,21 +127,21 @@ struct BugpointPass : public Pass {
RTLIL::Design *simplify_something(RTLIL::Design *design, int &seed, bool stage2, bool modules, bool ports, bool cells, bool connections, bool assigns, bool updates)
{
RTLIL::Design *design_copy = new RTLIL::Design;
- for (auto &it : design->modules_)
- design_copy->add(it.second->clone());
+ for (auto module : design->modules())
+ design_copy->add(module->clone());
int index = 0;
if (modules)
{
- for (auto &it : design_copy->modules_)
+ for (auto module : design_copy->modules())
{
- if (it.second->get_blackbox_attribute())
+ if (module->get_blackbox_attribute())
continue;
if (index++ == seed)
{
- log("Trying to remove module %s.\n", it.first.c_str());
- design_copy->remove(it.second);
+ log("Trying to remove module %s.\n", module->name.c_str());
+ design_copy->remove(module);
return design_copy;
}
}
@@ -178,12 +178,12 @@ struct BugpointPass : public Pass {
if (mod->get_blackbox_attribute())
continue;
- for (auto &it : mod->cells_)
+ for (auto cell : mod->cells())
{
if (index++ == seed)
{
- log("Trying to remove cell %s.%s.\n", mod->name.c_str(), it.first.c_str());
- mod->remove(it.second);
+ log("Trying to remove cell %s.%s.\n", mod->name.c_str(), cell->name.c_str());
+ mod->remove(cell);
return design_copy;
}
}
@@ -285,7 +285,7 @@ struct BugpointPass : public Pass {
}
}
}
- return NULL;
+ return nullptr;
}
void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
@@ -433,8 +433,8 @@ struct BugpointPass : public Pass {
{
Pass::call(design, "design -reset");
crashing_design = clean_design(crashing_design, clean, /*do_delete=*/true);
- for (auto &it : crashing_design->modules_)
- design->add(it.second->clone());
+ for (auto module : crashing_design->modules())
+ design->add(module->clone());
delete crashing_design;
}
}