From 5950c3c9a7729687a04f9b008e441959a2d9114d Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Mon, 14 Jul 2008 05:09:48 +0000 Subject: cpplib.h (NODE_CONDITIONAL): New. libcpp/ * include/cpplib.h (NODE_CONDITIONAL): New. (struct cpp_callbacks): New macro_to_expand field. (struct cpp_hashnode): Adjust size of flags and type fields. (cpp_peek_token): Prototype. * lex.c (cpp_peek_token): New function. (_cpp_temp_token): Protect pre-existing lookaheads. * macro.c (cpp_get_token): Expand any conditional macros. (_cpp_backup_tokens_direct): New. (_cpp_backup_tokens): Call _cpp_backup_tokens_direct. (warn_of_redefinition): Silently allow redefined conditional macros. (_cpp_create_definition): Remove the conditional flag when a user defines one of the conditional macros. * internal.h (_cpp_backup_tokens_direct): New prototype. gcc/ * c-common.h (C_CPP_HASHNODE): New macro. * coretypes.h (struct cpp_token): Forward declare. * doc/extend.texi (PowerPC AltiVec Built-in Functions): Document the context-sensitive keyword method. * config/rs6000/rs6000-c.c (__vector_keyword, vector_keyword, __pixel_keyword, pixel_keyword, __bool_keyword, bool_keyword, expand_bool_pixel): New. (altivec_categorize_keyword): New function. (init_vector_keywords): New function. (rs6000_macro_to_expand): Likewise. (rs6000_cpu_cpp_builtins): Enable context-sensitive macros if not compiling an ISO C dialect. gcc/testsuite/ * gcc.target/powerpc/altivec-macros.c: New test. * gcc.target/powerpc/altviec-26.c: Likewise. * gcc.dg/vmx/1b-06.c: Remove bool variable. * gcc.dg/vmx/1b-07.c: Likewise. * gcc.dg/vmx/1b-06-ansi.c: New test for the pre-define method. * gcc.dg/vmx/1b-07-ansi.c: Likewise. From-SVN: r137775 --- gcc/doc/extend.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 56e8926..eecb4ca 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -9120,9 +9120,10 @@ always specify the signedness. @item Compiling with @option{-maltivec} adds keywords @code{__vector}, -@code{__pixel}, and @code{__bool}. Macros @option{vector}, -@code{pixel}, and @code{bool} are defined in @code{} and can -be undefined. +@code{vector}, @code{__pixel}, @code{pixel}, @code{__bool} and +@code{bool}. When compiling ISO C, the context-sensitive substitution +of the keywords @code{vector}, @code{pixel} and @code{bool} is +disabled. To use them, you must include @code{} instead. @item GCC allows using a @code{typedef} name as the type specifier for a -- cgit v1.1