From ed3ed25ae077327ce01351036689cabbe71b957c Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:40:12 +1300 Subject: [PATCH] rtlil: Design::top_module() can be const Since it doesn't change anything and is just a lookup. --- kernel/rtlil.cc | 2 +- kernel/rtlil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 95e601413..8e597bcd0 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -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; diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 1bfe8c313..9b008b7aa 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -1205,7 +1205,7 @@ struct RTLIL::Design RTLIL::ObjRange 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;