[cfe-commits] [PATCH][Review request] - IndirectField + designated initializers.

Francois Pichet pichet2000 at gmail.com
Mon Dec 20 05:37:03 PST 2010


ping?
anybody planning to review this?

On Sun, Dec 12, 2010 at 10:23 PM, Francois Pichet <pichet2000 at gmail.com> wrote:
> More IndirectFieldDecl refactoring.
>
> This patch deals with a dark corner of clang: anonymous field
> initialized with designated-initializers (C99 feature)
> This is C++ mixing with C99.. not sure why clang supports that but it does.
>
> Example:
>
> struct Test {
>  union {
>      int a;
>      char b;
>  };
> };
>
> struct Test  var = { .a = 4 };
>
> Some explaining: currently designated anonymous fields are found via
> name look. Normal fields are found by iterating all the fields. This
> patch uses the fact that IndirectFieldDecl declarations will follow an
> anonymous implicit field to remove the special case of name lookup for
> anonymous field. With this patch there is no need to calculate the
> anonymous field position afterward. Clear enough?
>
> I also removed RecordDecl::getAnonymousStructOrUnionObject
> clang doesn't use it anymore since all anonymous fields handling is
> now done thought IndirectFieldDecl.
>




More information about the cfe-commits mailing list