aboutsummaryrefslogtreecommitdiff
path: root/gcc/stringpool.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/stringpool.c')
-rw-r--r--gcc/stringpool.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/stringpool.c b/gcc/stringpool.c
index ceb454d..f5e8968 100644
--- a/gcc/stringpool.c
+++ b/gcc/stringpool.c
@@ -340,6 +340,25 @@ maybe_get_identifier (text)
return NULL_TREE;
}
+/* Look up an identifier with the name TEXT, replace its identifier
+ node with NODE, and return the old identifier node. This is used
+ by languages which need to enable and disable keywords based on
+ context; e.g. see remember_protocol_qualifiers in objc/objc-act.c. */
+tree
+set_identifier (text, node)
+ const char *text;
+ tree node;
+{
+ struct str_header *str;
+ tree old;
+ size_t length = strlen (text);
+
+ str = alloc_string (text, length, INSERT);
+ old = str->data; /* might be null */
+ str->data = node;
+ return old;
+}
+
/* Report some basic statistics about the string pool. */
void