diff --git a/tgt-vhdl/cast.cc b/tgt-vhdl/cast.cc index 230108b12..22f6b89f4 100644 --- a/tgt-vhdl/cast.cc +++ b/tgt-vhdl/cast.cc @@ -1,7 +1,7 @@ /* * Generate code to convert between VHDL types. * - * Copyright (C) 2008 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2009 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,6 +60,8 @@ vhdl_expr *vhdl_expr::cast(const vhdl_type *to) assert(false); } } + assert(false); + return NULL; } /* @@ -140,9 +142,8 @@ vhdl_expr *vhdl_expr::to_boolean() conv->add_expr(this); return conv; } - else { - assert(false); - } + assert(false); + return NULL; } /* @@ -180,8 +181,8 @@ vhdl_expr *vhdl_expr::to_std_logic() return ah; } - else - assert(false); + assert(false); + return NULL; } /* @@ -274,8 +275,8 @@ vhdl_expr *vhdl_const_bits::to_vector(vhdl_type_name_t name, int w) value_.resize(w, sign_bit()); return this; } - else - assert(false); + assert(false); + return NULL; } vhdl_expr *vhdl_const_bits::to_integer() diff --git a/tgt-vhdl/state.cc b/tgt-vhdl/state.cc index 7acab014c..0ced93f27 100644 --- a/tgt-vhdl/state.cc +++ b/tgt-vhdl/state.cc @@ -139,6 +139,7 @@ ivl_signal_t find_signal_named(const std::string &name, const vhdl_scope *scope) return (*it).first; } assert(false); + return NULL; } // Compare the name of an entity against a string diff --git a/tgt-vhdl/stmt.cc b/tgt-vhdl/stmt.cc index d5f94c1e5..774ce9d06 100644 --- a/tgt-vhdl/stmt.cc +++ b/tgt-vhdl/stmt.cc @@ -239,9 +239,9 @@ assign_for(vhdl_decl::assign_type_t atype, vhdl_var_ref *lhs, vhdl_expr *rhs) return new vhdl_assign_stmt(lhs, rhs); case vhdl_decl::ASSIGN_NONBLOCK: return new vhdl_nbassign_stmt(lhs, rhs); - default: - assert(false); } + assert(false); + return NULL; } /* diff --git a/tgt-vhdl/support.cc b/tgt-vhdl/support.cc index 01eb16869..5001d5bc8 100644 --- a/tgt-vhdl/support.cc +++ b/tgt-vhdl/support.cc @@ -1,7 +1,7 @@ /* * Support functions for VHDL output. * - * Copyright (C) 2008 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2009 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,6 +51,7 @@ const char *support_function::function_name(support_function_t type) default: assert(false); } + return "Invalid"; } vhdl_type *support_function::function_type(support_function_t type) @@ -74,9 +75,9 @@ vhdl_type *support_function::function_type(support_function_t type) return new vhdl_type(VHDL_TYPE_UNSIGNED); case SF_LOGIC_TO_INTEGER: return vhdl_type::integer(); - default: - assert(false); } + assert(false); + return vhdl_type::boolean(); } void support_function::emit_ternary(std::ostream &of, int level) const diff --git a/tgt-vhdl/vhdl_syntax.hh b/tgt-vhdl/vhdl_syntax.hh index 326f70084..d1a278aae 100644 --- a/tgt-vhdl/vhdl_syntax.hh +++ b/tgt-vhdl/vhdl_syntax.hh @@ -571,7 +571,8 @@ public: // For some sorts of declarations it doesn't make sense // to assign to it so calling assignment_type just raises // an assertion failure - virtual assign_type_t assignment_type() const { assert(false); } + virtual assign_type_t assignment_type() const { assert(false); + return ASSIGN_BLOCK; } // True if this declaration can be read from virtual bool is_readable() const { return true; }