source: branches/libc-0.6/src/emx/include/demangle.h

Last change on this file was 1506, checked in by bird, 21 years ago

@unixroot. header reviews. ++

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 6.0 KB
Line 
1/* demangle.h,v 1.2 2004/09/14 22:27:32 bird Exp */
2/** @file
3 * GNU, -liberty.
4 */
5
6/* Defs for interface to demanglers.
7 Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001
8 Free Software Foundation, Inc.
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
13 any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
24
25
26#if !defined (DEMANGLE_H)
27#define DEMANGLE_H
28
29#include <ansidecl.h>
30
31/* Options passed to cplus_demangle (in 2nd parameter). */
32
33#define DMGL_NO_OPTS 0 /* For readability... */
34#define DMGL_PARAMS (1 << 0) /* Include function args */
35#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
36#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
37#define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
38#define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
39
40#define DMGL_AUTO (1 << 8)
41#define DMGL_GNU (1 << 9)
42#define DMGL_LUCID (1 << 10)
43#define DMGL_ARM (1 << 11)
44#define DMGL_HP (1 << 12) /* For the HP aCC compiler;
45 same as ARM except for
46 template arguments, etc. */
47#define DMGL_EDG (1 << 13)
48#define DMGL_GNU_V3 (1 << 14)
49#define DMGL_GNAT (1 << 15)
50
51/* If none of these are set, use 'current_demangling_style' as the default. */
52#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT)
53
54/* Enumeration of possible demangling styles.
55
56 Lucid and ARM styles are still kept logically distinct, even though
57 they now both behave identically. The resulting style is actual the
58 union of both. I.E. either style recognizes both "__pt__" and "__rf__"
59 for operator "->", even though the first is lucid style and the second
60 is ARM style. (FIXME?) */
61
62extern enum demangling_styles
63{
64 no_demangling = -1,
65 unknown_demangling = 0,
66 auto_demangling = DMGL_AUTO,
67 gnu_demangling = DMGL_GNU,
68 lucid_demangling = DMGL_LUCID,
69 arm_demangling = DMGL_ARM,
70 hp_demangling = DMGL_HP,
71 edg_demangling = DMGL_EDG,
72 gnu_v3_demangling = DMGL_GNU_V3,
73 java_demangling = DMGL_JAVA,
74 gnat_demangling = DMGL_GNAT
75} current_demangling_style;
76
77/* Define string names for the various demangling styles. */
78
79#define NO_DEMANGLING_STYLE_STRING "none"
80#define AUTO_DEMANGLING_STYLE_STRING "auto"
81#define GNU_DEMANGLING_STYLE_STRING "gnu"
82#define LUCID_DEMANGLING_STYLE_STRING "lucid"
83#define ARM_DEMANGLING_STYLE_STRING "arm"
84#define HP_DEMANGLING_STYLE_STRING "hp"
85#define EDG_DEMANGLING_STYLE_STRING "edg"
86#define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3"
87#define JAVA_DEMANGLING_STYLE_STRING "java"
88#define GNAT_DEMANGLING_STYLE_STRING "gnat"
89
90/* Some macros to test what demangling style is active. */
91
92#define CURRENT_DEMANGLING_STYLE current_demangling_style
93#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
94#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
95#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
96#define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
97#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
98#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
99#define GNU_V3_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
100#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
101#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
102
103/* Provide information about the available demangle styles. This code is
104 pulled from gdb into libiberty because it is useful to binutils also. */
105
106extern const struct demangler_engine
107{
108 const char *const demangling_style_name;
109 const enum demangling_styles demangling_style;
110 const char *const demangling_style_doc;
111} libiberty_demanglers[];
112
113extern char *
114cplus_demangle PARAMS ((const char *mangled, int options));
115
116extern int
117cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
118
119extern const char *
120cplus_mangle_opname PARAMS ((const char *opname, int options));
121
122/* Note: This sets global state. FIXME if you care about multi-threading. */
123
124extern void
125set_cplus_marker_for_demangling PARAMS ((int ch));
126
127extern enum demangling_styles
128cplus_demangle_set_style PARAMS ((enum demangling_styles style));
129
130extern enum demangling_styles
131cplus_demangle_name_to_style PARAMS ((const char *name));
132
133/* V3 ABI demangling entry points, defined in cp-demangle.c. */
134extern char*
135cplus_demangle_v3 PARAMS ((const char* mangled, int options));
136
137extern char*
138java_demangle_v3 PARAMS ((const char* mangled));
139
140
141enum gnu_v3_ctor_kinds {
142 gnu_v3_complete_object_ctor = 1,
143 gnu_v3_base_object_ctor,
144 gnu_v3_complete_object_allocating_ctor
145};
146
147/* Return non-zero iff NAME is the mangled form of a constructor name
148 in the G++ V3 ABI demangling style. Specifically, return an `enum
149 gnu_v3_ctor_kinds' value indicating what kind of constructor
150 it is. */
151extern enum gnu_v3_ctor_kinds
152 is_gnu_v3_mangled_ctor PARAMS ((const char *name));
153
154
155enum gnu_v3_dtor_kinds {
156 gnu_v3_deleting_dtor = 1,
157 gnu_v3_complete_object_dtor,
158 gnu_v3_base_object_dtor
159};
160
161/* Return non-zero iff NAME is the mangled form of a destructor name
162 in the G++ V3 ABI demangling style. Specifically, return an `enum
163 gnu_v3_dtor_kinds' value, indicating what kind of destructor
164 it is. */
165extern enum gnu_v3_dtor_kinds
166 is_gnu_v3_mangled_dtor PARAMS ((const char *name));
167
168#endif /* DEMANGLE_H */
Note: See TracBrowser for help on using the repository browser.