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