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:
parent
dab67f84da
commit
d8a9ad6860
3 changed files with 17 additions and 20 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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); };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue