[cfe-commits] [PATCH][Review request] - Anonymous union/struct redesign

Francois Pichet pichet2000 at gmail.com
Tue Nov 16 23:01:47 PST 2010


Hi, this patch implements the anonymous union/struct redesign as
proposed by John McCall.

A new AST node is introduced:
    def IndirectField : DDecl<Value>;

IndirectFields are injected into the parent class and chain back to
the original field.
example:
struct C {
   union { int a; char b; };
};
will inject 2 IndirectField (a, b) into scope C.

This mean name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.

After this patch is approved, I'll submit another patch for the
ms-anonymous struct using the same infrastructure.
After that I think some redesign could be done in SemInit.cpp
regarding anonymous handling. I didn't do it in this patch because I
think this patch is already large enough.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: anonymous.patch
Type: application/octet-stream
Size: 27502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101117/0e623c0c/attachment.obj>


More information about the cfe-commits mailing list