[cfe-commits] r95964 - in /cfe/trunk: include/clang/AST/Type.h include/clang/AST/TypeNodes.def lib/Sema/Sema.h

Sebastian Redl sebastian.redl at getdesigned.at
Fri Feb 12 00:58:23 PST 2010


On Fri, 12 Feb 2010 03:41:31 -0000, John McCall <rjmccall at apple.com>
wrote:
> Author: rjmccall
> Date: Thu Feb 11 21:41:30 2010
> New Revision: 95964
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=95964&view=rev
> Log:
> Waste two bits in every clang::Type so that the type class can be read
> in a single byte-load rather than some crazy bitmunging operation.
> 
>
==============================================================================
> --- cfe/trunk/include/clang/AST/Type.h (original)
> +++ cfe/trunk/include/clang/AST/Type.h Thu Feb 11 21:41:30 2010
> @@ -751,24 +751,22 @@
>  public:
>    enum TypeClass {
>  #define TYPE(Class, Base) Class,
> +#define LAST_TYPE(Class) TypeLast = Class,
>  #define ABSTRACT_TYPE(Class, Base)
>  #include "clang/AST/TypeNodes.def"

How about

+ TypeBeyondLast,
+ TypeLast = TypeBeyondLast - 1,

and leaving TypeNodes.def alone?

>    /// TypeClass bitfield - Enum that specifies what subclass this
belongs
>    to.
> +  unsigned TC : 8;
> +

We might want a static assertion that TypeLast < (1<<8).

Sebastian





More information about the cfe-commits mailing list