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