xref: /netbsd-src/external/gpl3/binutils/dist/libiberty/dwarfnames.c (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
1883529b6Schristos /* Names of various DWARF tags.
2*cb63e24eSchristos    Copyright (C) 2012-2024 Free Software Foundation, Inc.
3883529b6Schristos 
4883529b6Schristos This file is part of GNU CC.
5883529b6Schristos 
6883529b6Schristos GNU CC is free software; you can redistribute it and/or modify
7883529b6Schristos it under the terms of the GNU General Public License as published by
8883529b6Schristos the Free Software Foundation; either version 2, or (at your option)
9883529b6Schristos any later version.
10883529b6Schristos 
11883529b6Schristos In addition to the permissions in the GNU General Public License, the
12883529b6Schristos Free Software Foundation gives you unlimited permission to link the
13883529b6Schristos compiled version of this file into combinations with other programs,
14883529b6Schristos and to distribute those combinations without any restriction coming
15883529b6Schristos from the use of this file.  (The General Public License restrictions
16883529b6Schristos do apply in other respects; for example, they cover modification of
17883529b6Schristos the file, and distribution when not linked into a combined
18883529b6Schristos executable.)
19883529b6Schristos 
20883529b6Schristos GNU CC is distributed in the hope that it will be useful,
21883529b6Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of
22883529b6Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23883529b6Schristos GNU General Public License for more details.
24883529b6Schristos 
25883529b6Schristos You should have received a copy of the GNU General Public License
26883529b6Schristos along with GNU CC; see the file COPYING.  If not, write to
27883529b6Schristos the Free Software Foundation, 51 Franklin Street - Fifth Floor,
28883529b6Schristos Boston, MA 02110-1301, USA.  */
29883529b6Schristos 
30883529b6Schristos #include "dwarf2.h"
31883529b6Schristos 
32883529b6Schristos #define DW_FIRST_TAG(name, value) \
33883529b6Schristos   const char *get_DW_TAG_name (unsigned int tag)	\
34883529b6Schristos   { switch (tag) { \
35883529b6Schristos   DW_TAG (name, value)
36883529b6Schristos #define DW_END_TAG } return 0; }
37883529b6Schristos #define DW_FIRST_FORM(name, value) \
38883529b6Schristos   const char *get_DW_FORM_name (unsigned int form)	\
39883529b6Schristos   { switch (form) { \
40883529b6Schristos   DW_FORM (name, value)
41883529b6Schristos #define DW_END_FORM } return 0; }
42883529b6Schristos #define DW_FIRST_AT(name, value) \
43883529b6Schristos   const char *get_DW_AT_name (unsigned int attr) {	\
44883529b6Schristos   switch (attr) { \
45883529b6Schristos   DW_AT (name, value)
46883529b6Schristos #define DW_END_AT } return 0; }
47883529b6Schristos #define DW_FIRST_OP(name, value) \
48883529b6Schristos   const char *get_DW_OP_name (unsigned int op) {	\
49883529b6Schristos   switch (op) { \
50883529b6Schristos   DW_OP (name, value)
51883529b6Schristos #define DW_END_OP } return 0; }
52883529b6Schristos #define DW_FIRST_ATE(name, value)			\
53883529b6Schristos   const char *get_DW_ATE_name (unsigned int enc) {	\
54883529b6Schristos   switch (enc) { \
55883529b6Schristos   DW_ATE (name, value)
56883529b6Schristos #define DW_END_ATE } return 0; }
57883529b6Schristos #define DW_FIRST_CFA(name, value) \
58883529b6Schristos   const char *get_DW_CFA_name (unsigned int opc) {	\
59883529b6Schristos   switch (opc) {					\
60883529b6Schristos   DW_CFA (name, value)
61883529b6Schristos #define DW_END_CFA } return 0; }
62fc4f4269Schristos #define DW_FIRST_IDX(name, value) \
63fc4f4269Schristos   const char *get_DW_IDX_name (unsigned int idx) {	\
64fc4f4269Schristos   switch (idx) {					\
65fc4f4269Schristos   DW_IDX (name, value)
66fc4f4269Schristos #define DW_END_IDX } return 0; }
674f645668Schristos #define DW_FIRST_UT(name, value) \
684f645668Schristos   const char *get_DW_UT_name (unsigned int ut) {	\
694f645668Schristos   switch (ut) {					\
704f645668Schristos   DW_UT (name, value)
714f645668Schristos #define DW_END_UT } return 0; }
72883529b6Schristos 
73883529b6Schristos #define DW_TAG(name, value) case name: return # name ;
74883529b6Schristos #define DW_TAG_DUP(name, value)
75883529b6Schristos #define DW_FORM(name, value) case name: return # name ;
76883529b6Schristos #define DW_AT(name, value) case name: return # name ;
77883529b6Schristos #define DW_AT_DUP(name, value)
78883529b6Schristos #define DW_OP(name, value) case name: return # name ;
79883529b6Schristos #define DW_OP_DUP(name, value)
80883529b6Schristos #define DW_ATE(name, value) case name: return # name ;
81883529b6Schristos #define DW_ATE_DUP(name, value)
82883529b6Schristos #define DW_CFA(name, value) case name: return # name ;
83fc4f4269Schristos #define DW_CFA_DUP(name, value)
84fc4f4269Schristos #define DW_IDX(name, value) case name: return # name ;
85fc4f4269Schristos #define DW_IDX_DUP(name, value)
864f645668Schristos #define DW_UT(name, value) case name: return # name ;
87883529b6Schristos 
88883529b6Schristos #include "dwarf2.def"
89883529b6Schristos 
90883529b6Schristos #undef DW_FIRST_TAG
91883529b6Schristos #undef DW_END_TAG
92883529b6Schristos #undef DW_FIRST_FORM
93883529b6Schristos #undef DW_END_FORM
94883529b6Schristos #undef DW_FIRST_AT
95883529b6Schristos #undef DW_END_AT
96883529b6Schristos #undef DW_FIRST_OP
97883529b6Schristos #undef DW_END_OP
98883529b6Schristos #undef DW_FIRST_ATE
99883529b6Schristos #undef DW_END_ATE
100883529b6Schristos #undef DW_FIRST_CFA
101883529b6Schristos #undef DW_END_CFA
102fc4f4269Schristos #undef DW_FIRST_IDX
103fc4f4269Schristos #undef DW_END_IDX
1044f645668Schristos #undef DW_END_UT
105883529b6Schristos 
106883529b6Schristos #undef DW_TAG
107883529b6Schristos #undef DW_TAG_DUP
108883529b6Schristos #undef DW_FORM
109883529b6Schristos #undef DW_AT
110883529b6Schristos #undef DW_AT_DUP
111883529b6Schristos #undef DW_OP
112883529b6Schristos #undef DW_OP_DUP
113883529b6Schristos #undef DW_ATE
114883529b6Schristos #undef DW_ATE_DUP
115883529b6Schristos #undef DW_CFA
116fc4f4269Schristos #undef DW_CFA_DUP
117fc4f4269Schristos #undef DW_IDX
118fc4f4269Schristos #undef DW_IDX_DUP
119