dwarf2asm: Use constexpr for eh_data_format_name initialization for C++14mastertrunk
commit16dda95e39fa04e5ab43486a980e8866ee12efd7
authorJakub Jelinek <jakub@redhat.com>
Thu, 19 Sep 2024 15:53:27 +0000 (19 17:53 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 19 Sep 2024 15:53:27 +0000 (19 17:53 +0200)
treedc690a6df412548efae03abf561ab90d05327db7
parentcee868ae0dfb5bef590a0a82426d32ba1d2b1a92
dwarf2asm: Use constexpr for eh_data_format_name initialization for C++14

Similarly to the previous patch, dwarf2asm.cc had
HAVE_DESIGNATED_INITIALIZERS support, and as fallback a huge switch.
The switch from what I can see is expanded as a jump table with 256
label pointers and code at those labels then loads addresses of
string literals.
The following patch instead uses a table with 256 const char * pointers,
NULL for ICE, non-NULL for returning something, similarly to the
HAVE_DESIGNATED_INITIALIZERS case.

2024-09-19  Jakub Jelinek  <jakub@redhat.com>

* dwarf2asm.cc (eh_data_format_name): Use constexpr initialization
of format_names table for C++14 instead of a large switch.
gcc/dwarf2asm.cc