xref: /openbsd-src/gnu/gcc/libcpp/include/cpp-id-data.h (revision 404b540a9034ac75a6199ad1a32d1bbc7a0d4210)
1*404b540aSrobert /* Structures that hang off cpp_identifier, for PCH.
2*404b540aSrobert    Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3*404b540aSrobert    1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
4*404b540aSrobert 
5*404b540aSrobert This program is free software; you can redistribute it and/or modify it
6*404b540aSrobert under the terms of the GNU General Public License as published by the
7*404b540aSrobert Free Software Foundation; either version 2, or (at your option) any
8*404b540aSrobert later version.
9*404b540aSrobert 
10*404b540aSrobert This program is distributed in the hope that it will be useful,
11*404b540aSrobert but WITHOUT ANY WARRANTY; without even the implied warranty of
12*404b540aSrobert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*404b540aSrobert GNU General Public License for more details.
14*404b540aSrobert 
15*404b540aSrobert You should have received a copy of the GNU General Public License
16*404b540aSrobert along with this program; if not, write to the Free Software
17*404b540aSrobert Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18*404b540aSrobert 
19*404b540aSrobert #include "cpplib.h"
20*404b540aSrobert 
21*404b540aSrobert #if !defined (HAVE_UCHAR) && !defined (IN_GCC)
22*404b540aSrobert typedef unsigned char uchar;
23*404b540aSrobert #endif
24*404b540aSrobert 
25*404b540aSrobert #define U (const unsigned char *)  /* Intended use: U"string" */
26*404b540aSrobert 
27*404b540aSrobert /* Chained list of answers to an assertion.  */
28*404b540aSrobert struct answer GTY(())
29*404b540aSrobert {
30*404b540aSrobert   struct answer *next;
31*404b540aSrobert   unsigned int count;
32*404b540aSrobert   cpp_token GTY ((length ("%h.count"))) first[1];
33*404b540aSrobert };
34*404b540aSrobert 
35*404b540aSrobert /* Each macro definition is recorded in a cpp_macro structure.
36*404b540aSrobert    Variadic macros cannot occur with traditional cpp.  */
37*404b540aSrobert struct cpp_macro GTY(())
38*404b540aSrobert {
39*404b540aSrobert   /* Parameters, if any.  */
40*404b540aSrobert   cpp_hashnode ** GTY ((nested_ptr (union tree_node,
41*404b540aSrobert 		"%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
42*404b540aSrobert 			"%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL"),
43*404b540aSrobert 			length ("%h.paramc")))
44*404b540aSrobert     params;
45*404b540aSrobert 
46*404b540aSrobert   /* Replacement tokens (ISO) or replacement text (traditional).  See
47*404b540aSrobert      comment at top of cpptrad.c for how traditional function-like
48*404b540aSrobert      macros are encoded.  */
49*404b540aSrobert   union cpp_macro_u
50*404b540aSrobert   {
51*404b540aSrobert     cpp_token * GTY ((tag ("0"), length ("%0.count"))) tokens;
52*404b540aSrobert     const unsigned char * GTY ((tag ("1"))) text;
53*404b540aSrobert   } GTY ((desc ("%1.traditional"))) exp;
54*404b540aSrobert 
55*404b540aSrobert   /* Definition line number.  */
56*404b540aSrobert   source_location line;
57*404b540aSrobert 
58*404b540aSrobert   /* Number of tokens in expansion, or bytes for traditional macros.  */
59*404b540aSrobert   unsigned int count;
60*404b540aSrobert 
61*404b540aSrobert   /* Number of parameters.  */
62*404b540aSrobert   unsigned short paramc;
63*404b540aSrobert 
64*404b540aSrobert   /* If a function-like macro.  */
65*404b540aSrobert   unsigned int fun_like : 1;
66*404b540aSrobert 
67*404b540aSrobert   /* If a variadic macro.  */
68*404b540aSrobert   unsigned int variadic : 1;
69*404b540aSrobert 
70*404b540aSrobert   /* If macro defined in system header.  */
71*404b540aSrobert   unsigned int syshdr   : 1;
72*404b540aSrobert 
73*404b540aSrobert   /* Nonzero if it has been expanded or had its existence tested.  */
74*404b540aSrobert   unsigned int used     : 1;
75*404b540aSrobert 
76*404b540aSrobert   /* Indicate which field of 'exp' is in use.  */
77*404b540aSrobert   unsigned int traditional : 1;
78*404b540aSrobert };
79