[cfe-commits] r74224 - in /cfe/trunk: include/clang/Basic/TokenKinds.def lib/Basic/IdentifierTable.cpp
Chris Lattner
clattner at apple.com
Thu Jun 25 17:11:03 PDT 2009
On Jun 25, 2009, at 4:25 PM, Nate Begeman wrote:
> Author: sampo
> Date: Thu Jun 25 18:25:15 2009
> New Revision: 74224
>
> URL: http://llvm.org/viewvc/llvm-project?rev=74224&view=rev
> Log:
> OpenCL 1.0 Support: support "bool, true, false" tokens when
> compiling for OpenCL
Hey Nate,
Would it make sense to just add a new LangOpts.Bool flag, which gets
enabled by both OpenCL and C++?
-Chris
>
>
> Modified:
> cfe/trunk/include/clang/Basic/TokenKinds.def
> cfe/trunk/lib/Basic/IdentifierTable.cpp
>
> Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=74224&r1=74223&r2=74224&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
> +++ cfe/trunk/include/clang/Basic/TokenKinds.def Thu Jun 25 18:25:15
> 2009
> @@ -224,7 +224,7 @@
>
> // C++ 2.11p1: Keywords.
> KEYWORD(asm , KEYCXX|KEYGNU)
> -KEYWORD(bool , KEYCXX)
> +KEYWORD(bool , KEYCXX|BOOLSUPPORT)
> KEYWORD(catch , KEYCXX)
> KEYWORD(class , KEYCXX)
> KEYWORD(const_cast , KEYCXX)
> @@ -232,7 +232,7 @@
> KEYWORD(dynamic_cast , KEYCXX)
> KEYWORD(explicit , KEYCXX)
> KEYWORD(export , KEYCXX)
> -KEYWORD(false , KEYCXX)
> +KEYWORD(false , KEYCXX|BOOLSUPPORT)
> KEYWORD(friend , KEYCXX)
> KEYWORD(mutable , KEYCXX)
> KEYWORD(namespace , KEYCXX)
> @@ -246,7 +246,7 @@
> KEYWORD(template , KEYCXX)
> KEYWORD(this , KEYCXX)
> KEYWORD(throw , KEYCXX)
> -KEYWORD(true , KEYCXX)
> +KEYWORD(true , KEYCXX|BOOLSUPPORT)
> KEYWORD(try , KEYCXX)
> KEYWORD(typename , KEYCXX)
> KEYWORD(typeid , KEYCXX)
>
> Modified: cfe/trunk/lib/Basic/IdentifierTable.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/IdentifierTable.cpp?rev=74224&r1=74223&r2=74224&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Basic/IdentifierTable.cpp (original)
> +++ cfe/trunk/lib/Basic/IdentifierTable.cpp Thu Jun 25 18:25:15 2009
> @@ -66,7 +66,8 @@
> KEYCXX = 4,
> KEYCXX0X = 8,
> KEYGNU = 16,
> - KEYMS = 32
> + KEYMS = 32,
> + BOOLSUPPORT = 64
> };
> }
>
> @@ -88,6 +89,7 @@
> else if (LangOpts.C99 && (Flags & KEYC99)) AddResult = 2;
> else if (LangOpts.GNUMode && (Flags & KEYGNU)) AddResult = 1;
> else if (LangOpts.Microsoft && (Flags & KEYMS)) AddResult = 1;
> + else if (LangOpts.OpenCL && (Flags & BOOLSUPPORT)) AddResult = 2;
>
> // Don't add this keyword if disabled in this language.
> if (AddResult == 0) return;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list