From ae0b09dd3a5ec7aa28627e4cc72180635baa6618 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Mon, 16 Jun 2008 19:53:42 +0100 Subject: [PATCH] Don't bother emitting else part if it's empty --- tgt-vhdl/vhdl_syntax.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tgt-vhdl/vhdl_syntax.cc b/tgt-vhdl/vhdl_syntax.cc index 3935c0bd7..0af19d8b4 100644 --- a/tgt-vhdl/vhdl_syntax.cc +++ b/tgt-vhdl/vhdl_syntax.cc @@ -631,8 +631,10 @@ void vhdl_if_stmt::emit(std::ofstream &of, int level) const test_->emit(of, level); of << " then"; then_part_.emit(of, level); - of << "else"; - else_part_.emit(of, level); + if (!else_part_.empty()) { + of << "else"; + else_part_.emit(of, level); + } of << "end if;"; }