cpp-id-data.h revision 169695
1169695Skan/* Structures that hang off cpp_identifier, for PCH. 2169695Skan Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 3169695Skan 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 4169695Skan 5169695SkanThis program is free software; you can redistribute it and/or modify it 6169695Skanunder the terms of the GNU General Public License as published by the 7169695SkanFree Software Foundation; either version 2, or (at your option) any 8169695Skanlater version. 9169695Skan 10169695SkanThis program is distributed in the hope that it will be useful, 11169695Skanbut WITHOUT ANY WARRANTY; without even the implied warranty of 12169695SkanMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13169695SkanGNU General Public License for more details. 14169695Skan 15169695SkanYou should have received a copy of the GNU General Public License 16169695Skanalong with this program; if not, write to the Free Software 17169695SkanFoundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 18169695Skan 19169695Skan#include "cpplib.h" 20169695Skan 21169695Skan#if !defined (HAVE_UCHAR) && !defined (IN_GCC) 22169695Skantypedef unsigned char uchar; 23169695Skan#endif 24169695Skan 25169695Skan#define U (const unsigned char *) /* Intended use: U"string" */ 26169695Skan 27169695Skan/* Chained list of answers to an assertion. */ 28169695Skanstruct answer GTY(()) 29169695Skan{ 30169695Skan struct answer *next; 31169695Skan unsigned int count; 32169695Skan cpp_token GTY ((length ("%h.count"))) first[1]; 33169695Skan}; 34169695Skan 35169695Skan/* Each macro definition is recorded in a cpp_macro structure. 36169695Skan Variadic macros cannot occur with traditional cpp. */ 37169695Skanstruct cpp_macro GTY(()) 38169695Skan{ 39169695Skan /* Parameters, if any. */ 40169695Skan cpp_hashnode ** GTY ((nested_ptr (union tree_node, 41169695Skan "%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL", 42169695Skan "%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL"), 43169695Skan length ("%h.paramc"))) 44169695Skan params; 45169695Skan 46169695Skan /* Replacement tokens (ISO) or replacement text (traditional). See 47169695Skan comment at top of cpptrad.c for how traditional function-like 48169695Skan macros are encoded. */ 49169695Skan union cpp_macro_u 50169695Skan { 51169695Skan cpp_token * GTY ((tag ("0"), length ("%0.count"))) tokens; 52169695Skan const unsigned char * GTY ((tag ("1"))) text; 53169695Skan } GTY ((desc ("%1.traditional"))) exp; 54169695Skan 55169695Skan /* Definition line number. */ 56169695Skan source_location line; 57169695Skan 58169695Skan /* Number of tokens in expansion, or bytes for traditional macros. */ 59169695Skan unsigned int count; 60169695Skan 61169695Skan /* Number of parameters. */ 62169695Skan unsigned short paramc; 63169695Skan 64169695Skan /* If a function-like macro. */ 65169695Skan unsigned int fun_like : 1; 66169695Skan 67169695Skan /* If a variadic macro. */ 68169695Skan unsigned int variadic : 1; 69169695Skan 70169695Skan /* If macro defined in system header. */ 71169695Skan unsigned int syshdr : 1; 72169695Skan 73169695Skan /* Nonzero if it has been expanded or had its existence tested. */ 74169695Skan unsigned int used : 1; 75169695Skan 76169695Skan /* Indicate which field of 'exp' is in use. */ 77169695Skan unsigned int traditional : 1; 78169695Skan}; 79