[cfe-commits] [patch] _Bool in yvals.h

Chris Lattner clattner at apple.com
Fri May 21 13:24:12 PDT 2010


>> It should be easy to do directly. Check check out include/clang/TokenKinds.def and its uses; the _Bool keyword could probably be tagged with some new flag (e.g., KEYNOMS) that enables it unless -fms-extensions is provided.
>>  
> 
> Okay.  Is this better?

Looks good to me, applied in r104373!

FYI, your patches are coming through inlined, which makes them difficult to apply.  If you're using thunderbird, please follow the instructions here:
http://llvm.org/docs/DeveloperPolicy.html#patches

Thanks a lot!

-Chris

> 
> In Christ,
> Steven Watanabe
> 
> Index: tools/clang/include/clang/Basic/TokenKinds.def
> ===================================================================
> --- tools/clang/include/clang/Basic/TokenKinds.def	(revision 104222)
> +++ tools/clang/include/clang/Basic/TokenKinds.def	(working copy)
> @@ -220,7 +220,7 @@
> KEYWORD(void                        , KEYALL)
> KEYWORD(volatile                    , KEYALL)
> KEYWORD(while                       , KEYALL)
> -KEYWORD(_Bool                       , KEYALL)
> +KEYWORD(_Bool                       , KEYNOMS)
> KEYWORD(_Complex                    , KEYALL)
> KEYWORD(_Imaginary                  , KEYALL)
> KEYWORD(__func__                    , KEYALL)
> Index: tools/clang/lib/Basic/IdentifierTable.cpp
> ===================================================================
> --- tools/clang/lib/Basic/IdentifierTable.cpp	(revision 104222)
> +++ tools/clang/lib/Basic/IdentifierTable.cpp	(working copy)
> @@ -70,7 +70,8 @@
>     KEYGNU = 16,
>     KEYMS = 32,
>     BOOLSUPPORT = 64,
> -    KEYALTIVEC = 128
> +    KEYALTIVEC = 128,
> +    KEYNOMS = 256
>   };
> }
> 
> @@ -94,6 +95,7 @@
>   else if (LangOpts.Microsoft && (Flags & KEYMS)) AddResult = 1;
>   else if (LangOpts.Bool && (Flags & BOOLSUPPORT)) AddResult = 2;
>   else if (LangOpts.AltiVec && (Flags & KEYALTIVEC)) AddResult = 2;
> +  else if (!LangOpts.Microsoft && (Flags & KEYNOMS)) 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