aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtlil.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-12-23 16:16:06 +0100
committerGitHub <noreply@github.com>2018-12-23 16:16:06 +0100
commit245724a504528156485bbb32710b5e5444899ce1 (patch)
tree0f40d2aad76556901949dff62905a2eb7e40b331 /kernel/rtlil.cc
parent6dad1913779f729222f65e1098a4facb36c5837a (diff)
parent18291c20d2b17689729d9c36b08967e928e4e32a (diff)
downloadyosys-245724a504528156485bbb32710b5e5444899ce1.tar.gz
yosys-245724a504528156485bbb32710b5e5444899ce1.tar.bz2
yosys-245724a504528156485bbb32710b5e5444899ce1.zip
Merge pull request #761 from whitequark/proc_clean_partial
proc_clean: remove any empty cases, if possible to do safely
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r--kernel/rtlil.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 14259f8ed..8404db5e9 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -3793,6 +3793,11 @@ RTLIL::CaseRule::~CaseRule()
delete *it;
}
+bool RTLIL::CaseRule::empty() const
+{
+ return actions.empty() && switches.empty();
+}
+
RTLIL::CaseRule *RTLIL::CaseRule::clone() const
{
RTLIL::CaseRule *new_caserule = new RTLIL::CaseRule;
@@ -3809,6 +3814,11 @@ RTLIL::SwitchRule::~SwitchRule()
delete *it;
}
+bool RTLIL::SwitchRule::empty() const
+{
+ return cases.empty();
+}
+
RTLIL::SwitchRule *RTLIL::SwitchRule::clone() const
{
RTLIL::SwitchRule *new_switchrule = new RTLIL::SwitchRule;