"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)
commit99a084b7ae1479f445ec4d20754ea3ebe720d528
treebd5e1ff0603b3661acae028200a9d3498c502d54
parentfb7ace71cffc430c1af7a8fb6bfee717738a4378
"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.

llvm-svn: 185580
clang/include/clang/Basic/TokenKinds.def
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/DeclSpec.h
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/Parser.cpp
clang/lib/Sema/DeclSpec.cpp
clang/test/Parser/altivec-csk-bool.c [new file with mode: 0644]