From 191187ed1b7c714f949f3d9d8e7f6961ebc291ea Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Mon, 9 Jun 2008 16:40:32 +0100 Subject: [PATCH] Cosmetic change to avoid useless `null' statement after delay --- tgt-vhdl/stmt.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tgt-vhdl/stmt.cc b/tgt-vhdl/stmt.cc index eda40a6ff..3c4301c7a 100644 --- a/tgt-vhdl/stmt.cc +++ b/tgt-vhdl/stmt.cc @@ -204,9 +204,11 @@ static int draw_delay(vhdl_process *proc, ivl_statement_t stmt) proc->add_stmt(wait); // Expand the sub-statement as well - // Often this can result in a useless `null' statement - // Maybe add a check here and ignore it if it IVL_ST_NOOP? - draw_stmt(proc, ivl_stmt_sub_stmt(stmt)); + // Often this would result in a useless `null' statement which + // is caught here instead + ivl_statement_t sub_stmt = ivl_stmt_sub_stmt(stmt); + if (ivl_statement_type(sub_stmt) != IVL_ST_NOOP) + draw_stmt(proc, sub_stmt); return 0; }