summaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-09 21:18:15 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-09 21:18:15 +0000
commite14c5993de27982232381cc1d9f42d42514e982a (patch)
treefaf4076c83d65bd44e0d82d85813fd94e77029cf /gcc/cpphash.c
parent83b2aef3ec267ff247aeb25b373128e947eb7283 (diff)
downloadgcc-e14c5993de27982232381cc1d9f42d42514e982a.tar.gz
* cpphash.c: Move cpp_defined here from cpplib.c.
* cpplib.c: Update comments, move cpp_defined to cpphash.c. * cpplex.c (_cpp_lex_token): Don't leave the lexer at EOL. * cppmacro.c (cpp_get_token): Update comments, no need now to catch the CPP_EOF meaning EOL case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37345 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 50172d174ce..4804c8fec50 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -281,3 +281,16 @@ cpp_forall_identifiers (pfile, cb, v)
}
while (++p < limit);
}
+
+/* Determine whether the identifier ID, of length LEN, is a defined macro. */
+int
+cpp_defined (pfile, id, len)
+ cpp_reader *pfile;
+ const U_CHAR *id;
+ int len;
+{
+ cpp_hashnode *hp = cpp_lookup (pfile, id, len);
+
+ /* If it's of type NT_MACRO, it cannot be poisoned. */
+ return hp->type == NT_MACRO;
+}