mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-25 07:13:42 +00:00
Merge pull request #5112 from YosysHQ/krys/on_shutdown
design.cc: Use on_shutdown method
This commit is contained in:
commit
3a5ce2df64
2 changed files with 2 additions and 1 deletions
|
@ -29,6 +29,7 @@ struct Pass
|
||||||
{
|
{
|
||||||
std::string pass_name, short_help;
|
std::string pass_name, short_help;
|
||||||
Pass(std::string name, std::string short_help = "** document me **");
|
Pass(std::string name, std::string short_help = "** document me **");
|
||||||
|
// Prefer overriding 'Pass::on_shutdown()' if possible
|
||||||
virtual ~Pass();
|
virtual ~Pass();
|
||||||
|
|
||||||
virtual void help();
|
virtual void help();
|
||||||
|
|
|
@ -28,7 +28,7 @@ std::vector<RTLIL::Design*> pushed_designs;
|
||||||
|
|
||||||
struct DesignPass : public Pass {
|
struct DesignPass : public Pass {
|
||||||
DesignPass() : Pass("design", "save, restore and reset current design") { }
|
DesignPass() : Pass("design", "save, restore and reset current design") { }
|
||||||
~DesignPass() override {
|
void on_shutdown() override {
|
||||||
for (auto &it : saved_designs)
|
for (auto &it : saved_designs)
|
||||||
delete it.second;
|
delete it.second;
|
||||||
saved_designs.clear();
|
saved_designs.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue