From 3e28a1067688a1dd82abbfceb16a573f2f6e57a8 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Mon, 28 Jul 2008 13:02:04 +0100 Subject: [PATCH] Compress support function names a bit --- tgt-vhdl/support.cc | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/tgt-vhdl/support.cc b/tgt-vhdl/support.cc index 5e26f159a..0abee9fdd 100644 --- a/tgt-vhdl/support.cc +++ b/tgt-vhdl/support.cc @@ -33,28 +33,12 @@ void require_support_function(support_function_t f) const char *support_function::function_name(support_function_t type) { - switch (type) { - case SF_UNSIGNED_TO_BOOLEAN: - return "Unsigned_To_Boolean"; - case SF_SIGNED_TO_BOOLEAN: - return "Signed_To_Boolean"; - case SF_BOOLEAN_TO_LOGIC: - return "Boolean_To_Logic"; - case SF_REDUCE_OR: - return "Reduce_OR"; - case SF_REDUCE_AND: - return "Reduce_AND"; - case SF_REDUCE_XOR: - return "Reduce_XOR"; - case SF_TERNARY_LOGIC: - return "Ternary_Logic"; - case SF_TERNARY_UNSIGNED: - return "Ternary_Unsigned"; - case SF_TERNARY_SIGNED: - return "Ternary_Signed"; - default: - assert(false); - } + const char *names[] = + { "Unsigned_To_Boolean", "Signed_To_Boolean", "Boolean_To_Logic", + "Reduce_OR", "Reduce_AND", "Reduce_XOR", "Ternary_Logic", + "Ternary_Unsigned", "Ternary_Signed", NULL }; + + return names[type]; } vhdl_type *support_function::function_type(support_function_t type)