cpplib.h (NODE_CONDITIONAL): New.
authorBen Elliston <bje@au.ibm.com>
Mon, 14 Jul 2008 05:09:48 +0000 (05:09 +0000)
committerBen Elliston <bje@gcc.gnu.org>
Mon, 14 Jul 2008 05:09:48 +0000 (15:09 +1000)
commit5950c3c9a7729687a04f9b008e441959a2d9114d
tree5549f4ccea5a3b85211df500d0617fd3866b139f
parentb463e8de6c7e9c7fe8ad2f4f4be126f58b23c07a
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
17 files changed:
gcc/ChangeLog
gcc/c-common.h
gcc/config/rs6000/rs6000-c.c
gcc/coretypes.h
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vmx/1b-06-ansi.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vmx/1b-06.c
gcc/testsuite/gcc.dg/vmx/1b-07-ansi.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vmx/1b-07.c
gcc/testsuite/gcc.target/powerpc/altivec-26.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/altivec-macros.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/include/cpplib.h
libcpp/internal.h
libcpp/lex.c
libcpp/macro.c