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

Douglas Gregor dgregor at apple.com
Mon Dec 20 07:33:45 PST 2010


On Dec 20, 2010, at 5:37 AM, Francois Pichet wrote:

> ping?
> anybody planning to review this?

Yes, I'm planning to review it later today.

	- Doug

> 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.
>> 
> 
> _______________________________________________
> 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