summaryrefslogtreecommitdiff
path: root/passes/cmds/rename.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-26 21:16:05 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-26 21:30:38 +0200
commitd68c993ed2ea384db4d6af5161b3b36096828499 (patch)
tree4f1259436d3d8f73eb21f1a29662826a24cedf4c /passes/cmds/rename.cc
parent946ddff9cef3ea0b4dad8664319fb13074133775 (diff)
Changed more code to the new RTLIL::Wire constructors
Diffstat (limited to 'passes/cmds/rename.cc')
-rw-r--r--passes/cmds/rename.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/passes/cmds/rename.cc b/passes/cmds/rename.cc
index 519dce45..721d5c98 100644
--- a/passes/cmds/rename.cc
+++ b/passes/cmds/rename.cc
@@ -31,21 +31,15 @@ static void rename_in_module(RTLIL::Module *module, std::string from_name, std::
for (auto &it : module->wires)
if (it.first == from_name) {
- RTLIL::Wire *wire = it.second;
- log("Renaming wire %s to %s in module %s.\n", wire->name.c_str(), to_name.c_str(), module->name.c_str());
- module->wires.erase(wire->name);
- wire->name = to_name;
- module->add(wire);
+ log("Renaming wire %s to %s in module %s.\n", log_id(it.second), log_id(to_name), log_id(module));
+ module->rename(it.second, to_name);
return;
}
for (auto &it : module->cells)
if (it.first == from_name) {
- RTLIL::Cell *cell = it.second;
- log("Renaming cell %s to %s in module %s.\n", cell->name.c_str(), to_name.c_str(), module->name.c_str());
- module->cells.erase(cell->name);
- cell->name = to_name;
- module->add(cell);
+ log("Renaming cell %s to %s in module %s.\n", log_id(it.second), log_id(to_name), log_id(module));
+ module->rename(it.second, to_name);
return;
}