3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 09:55:20 +00:00

Clean up pseudo-private member usage in kernel/yosys.cc.

This commit is contained in:
Alberto Gonzalez 2020-04-01 02:53:56 +00:00
parent 05f74d4f31
commit ae05795f54
No known key found for this signature in database
GPG key ID: 8395A8BA109708B2

View file

@ -1098,30 +1098,29 @@ static char *readline_obj_generator(const char *text, int state)
if (design->selected_active_module.empty()) if (design->selected_active_module.empty())
{ {
for (auto &it : design->modules_) for (auto mod : design->modules())
if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0) if (RTLIL::unescape_id(mod->name).compare(0, len, text) == 0)
obj_names.push_back(strdup(RTLIL::id2cstr(it.first))); obj_names.push_back(strdup(log_id(mod->name)));
} }
else else if (design->module(design->selected_active_module) != nullptr)
if (design->modules_.count(design->selected_active_module) > 0)
{ {
RTLIL::Module *module = design->modules_.at(design->selected_active_module); RTLIL::Module *module = design->module(design->selected_active_module);
for (auto &it : module->wires_) for (auto w : module->wires())
if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0) if (RTLIL::unescape_id(w->name).compare(0, len, text) == 0)
obj_names.push_back(strdup(RTLIL::id2cstr(it.first))); obj_names.push_back(strdup(log_id(w->name)));
for (auto &it : module->memories) for (auto &it : module->memories)
if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0) if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0)
obj_names.push_back(strdup(RTLIL::id2cstr(it.first))); obj_names.push_back(strdup(log_id(it.first)));
for (auto &it : module->cells_) for (auto cell : module->cells())
if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0) if (RTLIL::unescape_id(cell->name).compare(0, len, text) == 0)
obj_names.push_back(strdup(RTLIL::id2cstr(it.first))); obj_names.push_back(strdup(log_id(cell->name)));
for (auto &it : module->processes) for (auto &it : module->processes)
if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0) if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0)
obj_names.push_back(strdup(RTLIL::id2cstr(it.first))); obj_names.push_back(strdup(log_id(it.first)));
} }
std::sort(obj_names.begin(), obj_names.end()); std::sort(obj_names.begin(), obj_names.end());