xref: /openbsd-src/gnu/gcc/libcpp/include/cpp-id-data.h (revision 48a9be13bb6bd15d53ffafb613c536206bf691a3)
1404b540aSrobert /* Structures that hang off cpp_identifier, for PCH.
2404b540aSrobert    Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3404b540aSrobert    1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
4404b540aSrobert 
5404b540aSrobert This program is free software; you can redistribute it and/or modify it
6404b540aSrobert under the terms of the GNU General Public License as published by the
7404b540aSrobert Free Software Foundation; either version 2, or (at your option) any
8404b540aSrobert later version.
9404b540aSrobert 
10404b540aSrobert This program is distributed in the hope that it will be useful,
11404b540aSrobert but WITHOUT ANY WARRANTY; without even the implied warranty of
12404b540aSrobert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13404b540aSrobert GNU General Public License for more details.
14404b540aSrobert 
15404b540aSrobert You should have received a copy of the GNU General Public License
16404b540aSrobert along with this program; if not, write to the Free Software
17404b540aSrobert Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18404b540aSrobert 
19404b540aSrobert #include "cpplib.h"
20404b540aSrobert 
21*48a9be13Srobert #if !defined (HAVE_UCHAR)
22404b540aSrobert typedef unsigned char uchar;
23404b540aSrobert #endif
24404b540aSrobert 
25404b540aSrobert #define U (const unsigned char *)  /* Intended use: U"string" */
26404b540aSrobert 
27404b540aSrobert /* Chained list of answers to an assertion.  */
28404b540aSrobert struct answer GTY(())
29404b540aSrobert {
30404b540aSrobert   struct answer *next;
31404b540aSrobert   unsigned int count;
32404b540aSrobert   cpp_token GTY ((length ("%h.count"))) first[1];
33404b540aSrobert };
34404b540aSrobert 
35404b540aSrobert /* Each macro definition is recorded in a cpp_macro structure.
36404b540aSrobert    Variadic macros cannot occur with traditional cpp.  */
37404b540aSrobert struct cpp_macro GTY(())
38404b540aSrobert {
39404b540aSrobert   /* Parameters, if any.  */
40404b540aSrobert   cpp_hashnode ** GTY ((nested_ptr (union tree_node,
41404b540aSrobert 		"%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
42404b540aSrobert 			"%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL"),
43404b540aSrobert 			length ("%h.paramc")))
44404b540aSrobert     params;
45404b540aSrobert 
46404b540aSrobert   /* Replacement tokens (ISO) or replacement text (traditional).  See
47404b540aSrobert      comment at top of cpptrad.c for how traditional function-like
48404b540aSrobert      macros are encoded.  */
49404b540aSrobert   union cpp_macro_u
50404b540aSrobert   {
51404b540aSrobert     cpp_token * GTY ((tag ("0"), length ("%0.count"))) tokens;
52404b540aSrobert     const unsigned char * GTY ((tag ("1"))) text;
53404b540aSrobert   } GTY ((desc ("%1.traditional"))) exp;
54404b540aSrobert 
55404b540aSrobert   /* Definition line number.  */
56404b540aSrobert   source_location line;
57404b540aSrobert 
58404b540aSrobert   /* Number of tokens in expansion, or bytes for traditional macros.  */
59404b540aSrobert   unsigned int count;
60404b540aSrobert 
61404b540aSrobert   /* Number of parameters.  */
62404b540aSrobert   unsigned short paramc;
63404b540aSrobert 
64404b540aSrobert   /* If a function-like macro.  */
65404b540aSrobert   unsigned int fun_like : 1;
66404b540aSrobert 
67404b540aSrobert   /* If a variadic macro.  */
68404b540aSrobert   unsigned int variadic : 1;
69404b540aSrobert 
70404b540aSrobert   /* If macro defined in system header.  */
71404b540aSrobert   unsigned int syshdr   : 1;
72404b540aSrobert 
73404b540aSrobert   /* Nonzero if it has been expanded or had its existence tested.  */
74404b540aSrobert   unsigned int used     : 1;
75404b540aSrobert 
76404b540aSrobert   /* Indicate which field of 'exp' is in use.  */
77404b540aSrobert   unsigned int traditional : 1;
78404b540aSrobert };
79