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