rtlil: Design::top_module() can be const

Since it doesn't change anything and is just a lookup.
This commit is contained in:
Krystine Sherwin 2024-11-20 09:40:12 +13:00
parent 9484d169c8
commit ed3ed25ae0
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -932,7 +932,7 @@ const RTLIL::Module *RTLIL::Design::module(const RTLIL::IdString& name) const
return modules_.count(name) ? modules_.at(name) : NULL;
}
RTLIL::Module *RTLIL::Design::top_module()
RTLIL::Module *RTLIL::Design::top_module() const
{
RTLIL::Module *module = nullptr;
int module_count = 0;

View File

@ -1205,7 +1205,7 @@ struct RTLIL::Design
RTLIL::ObjRange<RTLIL::Module*> modules();
RTLIL::Module *module(const RTLIL::IdString &name);
const RTLIL::Module *module(const RTLIL::IdString &name) const;
RTLIL::Module *top_module();
RTLIL::Module *top_module() const;
bool has(const RTLIL::IdString &id) const {
return modules_.count(id) != 0;