3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-04 21:39:14 +00:00

Make RTLIL::Design::get_all_designs() unconditionally defined

This commit is contained in:
Robert O'Callahan 2025-10-09 22:54:26 +00:00
parent 3a4fa325cc
commit 8b8939e219
2 changed files with 0 additions and 8 deletions

View file

@ -1084,9 +1084,7 @@ RTLIL::Design::Design()
refcount_modules_ = 0; refcount_modules_ = 0;
push_full_selection(); push_full_selection();
#ifdef YOSYS_ENABLE_PYTHON
RTLIL::Design::get_all_designs()->insert(std::pair<unsigned int, RTLIL::Design*>(hashidx_, this)); RTLIL::Design::get_all_designs()->insert(std::pair<unsigned int, RTLIL::Design*>(hashidx_, this));
#endif
} }
RTLIL::Design::~Design() RTLIL::Design::~Design()
@ -1095,18 +1093,14 @@ RTLIL::Design::~Design()
delete pr.second; delete pr.second;
for (auto n : bindings_) for (auto n : bindings_)
delete n; delete n;
#ifdef YOSYS_ENABLE_PYTHON
RTLIL::Design::get_all_designs()->erase(hashidx_); RTLIL::Design::get_all_designs()->erase(hashidx_);
#endif
} }
#ifdef YOSYS_ENABLE_PYTHON
static std::map<unsigned int, RTLIL::Design*> all_designs; static std::map<unsigned int, RTLIL::Design*> all_designs;
std::map<unsigned int, RTLIL::Design*> *RTLIL::Design::get_all_designs(void) std::map<unsigned int, RTLIL::Design*> *RTLIL::Design::get_all_designs(void)
{ {
return &all_designs; return &all_designs;
} }
#endif
RTLIL::ObjRange<RTLIL::Module*> RTLIL::Design::modules() RTLIL::ObjRange<RTLIL::Module*> RTLIL::Design::modules()
{ {

View file

@ -1700,9 +1700,7 @@ struct RTLIL::Design
// returns all selected unboxed whole modules, warning the user if any // returns all selected unboxed whole modules, warning the user if any
// partially selected or boxed modules have been ignored // partially selected or boxed modules have been ignored
std::vector<RTLIL::Module*> selected_unboxed_whole_modules_warn() const { return selected_modules(SELECT_WHOLE_WARN, SB_UNBOXED_WARN); } std::vector<RTLIL::Module*> selected_unboxed_whole_modules_warn() const { return selected_modules(SELECT_WHOLE_WARN, SB_UNBOXED_WARN); }
#ifdef YOSYS_ENABLE_PYTHON
static std::map<unsigned int, RTLIL::Design*> *get_all_designs(void); static std::map<unsigned int, RTLIL::Design*> *get_all_designs(void);
#endif
}; };
struct RTLIL::Module : public RTLIL::NamedObject struct RTLIL::Module : public RTLIL::NamedObject