3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

Add Selection::clear() method

Use method in `select.cc` to reduce code duplication.
This commit is contained in:
Krystine Sherwin 2025-04-05 10:56:01 +13:00
parent dab67f84da
commit d8a9ad6860
No known key found for this signature in database
3 changed files with 17 additions and 20 deletions

View file

@ -891,6 +891,14 @@ void RTLIL::Selection::optimize(RTLIL::Design *design)
}
}
void RTLIL::Selection::clear()
{
full_selection = false;
complete_selection = false;
selected_modules.clear();
selected_members.clear();
}
RTLIL::Design::Design()
: verilog_defines (new define_map_t)
{

View file

@ -1241,6 +1241,9 @@ struct RTLIL::Selection
return !selects_all() && selected_modules.empty() && selected_members.empty();
}
// clear this selection, leaving it empty
void clear();
// create a new selection which is empty
static Selection EmptySelection(RTLIL::Design *design = nullptr) { return Selection(false, false, design); };