cpp-id-data.h 2.7 KB

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