aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-02-18 14:31:26 -0500
committerSimon Marchi <simon.marchi@efficios.com>2025-03-10 16:09:02 -0400
commit32a187da7622e8fdbdd275fb99c78e1927f8f602 (patch)
tree1310607be0af6428e1d903bea6f9e66938cb5d33 /libiberty
parentb3fa38aef59d97a8ce57395b1f3902f6361d9bd4 (diff)
downloadbinutils-32a187da7622e8fdbdd275fb99c78e1927f8f602.zip
binutils-32a187da7622e8fdbdd275fb99c78e1927f8f602.tar.gz
binutils-32a187da7622e8fdbdd275fb99c78e1927f8f602.tar.bz2
libiberty: move DW_LANG_* definitions to dwarf2.def
In order to get a "DW_LANG_* to string" function: - move the "DW_LANG_*" definitions from dwarf2.h to dwarf2.def - add the necessary macros in dwarf2.h to generate the enumeration - add the necessary macros in dwarfnames.c to generate the "to string" function include/ChangeLog: * dwarf2.h (DW_LANG, DW_FIRST_LANG, DW_END_LANG): Define then undefine. (enum dwarf_source_language): Remove. (get_DW_LANG_name): Declare. * dwarf2.def: Define DW_LANG_* constants. libiberty/ChangeLog: * dwarfnames.c (DW_FIRST_LANG, DW_END_LANG, DW_LANG): Define then undefine. Change-Id: I440aa2b1f55c7585d7e44c8fa7c41310b0ef2b3a Cc: binutils@sourceware.org
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/dwarfnames.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libiberty/dwarfnames.c b/libiberty/dwarfnames.c
index cf0780c..4de143d 100644
--- a/libiberty/dwarfnames.c
+++ b/libiberty/dwarfnames.c
@@ -69,6 +69,11 @@ Boston, MA 02110-1301, USA. */
switch (ut) { \
DW_UT (name, value)
#define DW_END_UT } return 0; }
+#define DW_FIRST_LANG(name, value) \
+ const char *get_DW_LANG_name (unsigned int lang) { \
+ switch (lang) { \
+ DW_LANG (name, value)
+#define DW_END_LANG } return 0; }
#define DW_TAG(name, value) case name: return # name ;
#define DW_TAG_DUP(name, value)
@@ -84,6 +89,7 @@ Boston, MA 02110-1301, USA. */
#define DW_IDX(name, value) case name: return # name ;
#define DW_IDX_DUP(name, value)
#define DW_UT(name, value) case name: return # name ;
+#define DW_LANG(name, value) case name: return # name ;
#include "dwarf2.def"
@@ -102,6 +108,8 @@ Boston, MA 02110-1301, USA. */
#undef DW_FIRST_IDX
#undef DW_END_IDX
#undef DW_END_UT
+#undef DW_FIRST_LANG
+#undef DW_END_LANG
#undef DW_TAG
#undef DW_TAG_DUP
@@ -116,3 +124,4 @@ Boston, MA 02110-1301, USA. */
#undef DW_CFA_DUP
#undef DW_IDX
#undef DW_IDX_DUP
+#undef DW_LANG