[cfe-commits] r62737 - in /cfe/trunk: include/clang/AST/Expr.h include/clang/AST/StmtNodes.def include/clang/Basic/DiagnosticKinds.def include/clang/Parse/Action.h include/clang/Parse/Designator.h lib/AST/Expr.cpp lib/AST/StmtPrinter.cpp lib/Pars

Eli Friedman eli.friedman at gmail.com
Wed Jan 21 20:12:09 PST 2009


On Wed, Jan 21, 2009 at 4:58 PM, Douglas Gregor <dgregor at apple.com> wrote:
> Author: dgregor
> Date: Wed Jan 21 18:58:24 2009
> New Revision: 62737
>
> URL: http://llvm.org/viewvc/llvm-project?rev=62737&view=rev
> Log:
> Initial implementation of semantic analysis and ASTs for C99
> designated initializers. This implementation should cover all of the
> constraints in C99 6.7.8, including long, complex designations and
> computing the size of incomplete array types initialized with a
> designated initializer. Please see the new test-case and holler if you
> find cases where this doesn't work.

Nice start!  It looks like there's still a lot of work to do, though.

One simple case that doesn't work:
struct {int x,*y;} z[] = {[0].x = 2, &z[0].x};
I think this indicates a rather serious error in the way you're doing
the recursion.


Do you have any thoughts on how to implement CodeGen without
duplicating all the designator logic?

-Eli



More information about the cfe-commits mailing list