Commit Graph

4 Commits

Author SHA1 Message Date
Douglas Gregor d42a0fb41b Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.

llvm-svn: 63435
2009-01-30 22:26:29 +00:00
Douglas Gregor 347f7eabb9 Code generation support for C99 designated initializers.
The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
  - Designating a member of a union that isn't the first member may
    result in bogus initialization (we warn about this)
  - GNU array-range designators are not supported (we warn about this)

llvm-svn: 63242
2009-01-28 21:54:33 +00:00
Nate Begeman ce4d7fce6b OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.
llvm-svn: 49942
2008-04-18 23:10:10 +00:00
Nate Begeman 43eec490fb Support checking and codegen of constant vector globals
llvm-svn: 46343
2008-01-25 05:34:48 +00:00