[cfe-commits] [PATCH][MS][Review request] - Microsoft C anonymous struct

John McCall rjmccall at apple.com
Mon Nov 22 21:47:43 PST 2010


On Nov 22, 2010, at 9:44 PM, Francois Pichet wrote:

> On Mon, Nov 22, 2010 at 5:06 AM, John McCall <rjmccall at apple.com> wrote:
>> On Nov 21, 2010, at 5:02 PM, Francois Pichet wrote:
>>> Now that the general anonymous union/struct redesign is done
>>> (semainit.cpp to come later), here is an updated ms anonymous struct
>>> patch.
>> 
>> Hmm.  I think we can simplify the InjectAnonymousStructOrUnionMembers logic a little, and then we wouldn't need the new parameter or, indeed, for it to be recursive at all.  All you need to do is look for both FieldDecls *and* InjectedFieldDecls when walking the record.  That way we don't have to re-derive whether a particular anonymous field causes an injection — we just ignore anonymous fields and forward anything which might already have been injected.
>> 
>> Also, there are tabs in test/Sema/MicrosoftExtensions.c.

Looks good!  One extremely minor quibble:

+  // Create a declaration for this anonymous struct.
+  NamedDecl* Anon = FieldDecl::Create(Context,
+                             dyn_cast<RecordDecl>(CurContext),

This can be cast<>.

John.



More information about the cfe-commits mailing list