aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-pragma.c
diff options
context:
space:
mode:
authorGeoff Keating <geoffk@cygnus.com>1999-09-09 04:00:37 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>1999-09-09 04:00:37 +0000
commitfc009f966c98317401b51127f59de4ad37bb7d19 (patch)
treeadfb849ae0813b5bacab43fb7a7ab5ec23bc7fb6 /gcc/c-pragma.c
parentd60f72aec57414b8339eecb25c33b423af7e6946 (diff)
downloadgcc-fc009f966c98317401b51127f59de4ad37bb7d19.zip
gcc-fc009f966c98317401b51127f59de4ad37bb7d19.tar.gz
gcc-fc009f966c98317401b51127f59de4ad37bb7d19.tar.bz2
Makefile.in (cppexp.o): Depend on cpphash.h.
* Makefile.in (cppexp.o): Depend on cpphash.h. * cppexp.c (cpp_lex): Handle `defined (xxx)' for poisoned xxx. Include cpphash.h. * cpphash.c (special_symbol): Handle plain `xxx' for poisoned xxx. * cpplib.c (do_define): Generalise to handle poisoned definitions, redefining poisoned identifiers, etc. (do_undef): Don't allow poisoned identifiers to be undefined. (do_pragma): Add #pragma poison. (do_xifdef): Handle `#ifdef xxx' for poisoned xxx. * cccp.c: Add T_POISON node type. (special_symbol): Handle `defined(xxx)' and plain `xxx' for poisoned xxx. (do_define): Generalise to handle poisoned definitions, redefining poisoned identifiers, etc. (do_undef): Don't allow poisoned identifiers to be undefined. (do_pragma): Add #pragma poison. (do_xifdef): Handle `#ifdef xxx' for poisoned xxx. * c-pragma.c (handle_pragma_token): Ignore #pragma poison. * c-pragma.h: Add ps_poison state. We now always have generic pragmas. From-SVN: r29224
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r--gcc/c-pragma.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 017bdef..bfb6bdc 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -300,6 +300,10 @@ handle_pragma_token (string, token)
ret_val = 1; /* Ignore the pragma. */
break;
#endif /* HANDLE_PRAGMA_WEAK */
+
+ case ps_poison:
+ ret_val = 1;
+ break;
}
type = state = ps_start;
@@ -338,9 +342,11 @@ handle_pragma_token (string, token)
#ifdef HANDLE_PRAGMA_WEAK
if (strcmp (string, "weak") == 0)
type = state = ps_weak;
-#endif
+#endif
+ if (strcmp (string, "poison") == 0)
+ type = state = ps_poison;
break;
-
+
#ifdef HANDLE_PRAGMA_WEAK
case ps_weak:
name = permalloc (strlen (string) + 1);
@@ -485,7 +491,12 @@ handle_pragma_token (string, token)
state = ps_bad;
break;
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
-
+
+ case ps_poison:
+ if (token && TREE_CODE (token) != IDENTIFIER_NODE)
+ state = ps_bad;
+ break;
+
case ps_bad:
case ps_done:
break;