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