]> granicus.if.org Git - clang/commit
"bool" should be a context-sensitive keyword in Altivec mode.
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Wed, 3 Jul 2013 20:54:09 +0000 (20:54 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Wed, 3 Jul 2013 20:54:09 +0000 (20:54 +0000)
commit3e3d20b2b26a885fcae855bb0b02dbc42d7c5739
tree340c386acf7c9cb1dc6f90705ed3fbddb4e5d829
parentf0d14cb8c8f95c9039e4ea1f5966f233a76ba1d8
"bool" should be a context-sensitive keyword in Altivec mode.

PR16456 reported that Clang implements a hybrid between AltiVec's
"Keyword and Predefine Method" and its "Context Sensitive Keyword
Method," where "bool" is always a keyword, but "vector" and "pixel"
are context-sensitive keywords.  This isn't permitted by the AltiVec
spec.  For consistency with gcc, this patch implements the Context
Sensitive Keyword Method for bool, and stops treating true and false
as keywords in Altivec mode.

The patch removes KEYALTIVEC as a trigger for defining these keywords
in include/clang/Basic/TokenKinds.def, and adds logic for "vector
bool" that mirrors the existing logic for "vector pixel."  The test
case is taken from the bug report.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185580 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/TokenKinds.def
include/clang/Parse/Parser.h
include/clang/Sema/DeclSpec.h
lib/Parse/ParseDecl.cpp
lib/Parse/Parser.cpp
lib/Sema/DeclSpec.cpp
test/Parser/altivec-csk-bool.c [new file with mode: 0644]