stringpool.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Declarations and definitons for stringpool.c.
  2. Copyright (C) 2013-2015 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_STRINGPOOL_H
  16. #define GCC_STRINGPOOL_H
  17. /* Return the (unique) IDENTIFIER_NODE node for a given name.
  18. The name is supplied as a char *. */
  19. extern tree get_identifier (const char *);
  20. /* If an identifier with the name TEXT (a null-terminated string) has
  21. previously been referred to, return that node; otherwise return
  22. NULL_TREE. */
  23. extern tree maybe_get_identifier (const char *);
  24. /* Identical to get_identifier, except that the length is assumed
  25. known. */
  26. extern tree get_identifier_with_length (const char *, size_t);
  27. #if GCC_VERSION >= 3000
  28. #define get_identifier(str) \
  29. (__builtin_constant_p (str) \
  30. ? get_identifier_with_length ((str), strlen (str)) \
  31. : get_identifier (str))
  32. #endif
  33. #endif // GCC_STRINGPOOL_H