History log of /external/clang/test/Sema/designated-initializers.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
86dd09bf29d406e2bd3dfe45ad59a61ca870ff01 08-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> This patch fixes multiple issues in clang's designated init builder and
completes support for C1X anonymous struct/union init features:

* Indexed anonymous member initializers should not be expanded. Doing so makes
little sense and would cause unresolvable semantic ambiguity in valid code
(regression introduced by r69153).

* Subobject initialization of (possibly nested) anonymous members are now
referred to with paths relative to the naming record context, eliminating the
synthesis of incorrect implicit InitListExprs that caused CodeGen to assert.

* Field lookup was missing a null check in IdentifierInfo comparison which
caused lookup for a known (already resolved) field to match the first unnamed
data member it encountered leading to silent miscompilation.

* Subobject paths are no longer built using the general purpose
Sema::BuildAnonymousStructUnionMemberPath(). If any corner cases crop up, we
will now assert earlier in Sema instead of passing invalid InitListExprs
through to CodeGen.

Fixes PR6955, from Alp Toker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
6cebeb040be3ea2ff1ffa3b97b33ed62bd53ca4a 22-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> When filling in value initializations within an initializer list, be
sure to fill in the initialized member of a union when a member was
explicitly designated. Fixes PR5843.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
3573b2c84372d9484296fa658f5276f6c09acb92 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
cfb095216ddf3922d25a479da8430a54eb4068ec 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Remove the -arch option from clang-cc: for all practical purposes, it's
redundant with -triple.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
eec8ae2c3665db2d293850a695e5a3b3cb57a50a 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR4073 by making designated initializer checking code use
VerifyIntegerConstantExpression instead of isIntegerConstantExpr.
This makes it ext-warn but tolerate things that fold to a constant
but that are not valid i-c-e's.

There must be a bug in the i-c-e computation though, because it
doesn't catch this case even with pedantic.

This also switches the later code to use EvaluateAsInt which is
simpler and handles everything that evaluate does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
cc94ab72501999e1d61a538f9891523603f9236c 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implement support for designated initializers that refer to members of
anonymous structs or unions. Fixes PR3778.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
5f34f0ee70302e8ce1fb6dd8ba4c03e873762476 28-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Make our diagnostics about the obsolete GNU designated-initializer
syntax into extension warnings, and provide code-modification hints
showing how to fix the problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
ffd408a50adb01ae9c0ad92fb5f0981e1ca72df5 24-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename clang to clang-cc.

Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
c25bf6d949f81d248750b1d2289a4b5905e39500 18-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Downgrade the "excess elements in initializer" errors to warnings *in
C*. They're required errors in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
0ecc9e9bd22decf2a02a3359d69802a72b7a632e 12-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Fix a bug with designated initializers where we were stepping out of a
union subobject initialization before checking whether the next
initiailizer was actually a designated initializer. This led to
spurious "excess elements in union initializer" errors. Thanks to
rdivacky for reporting the bug!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
d7e76c5e518f9d805dd94400308878204d62ea8b 09-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> When handling "the rest" of a designated array subobject, maybe sure
to tell it that it wasn't (directly) designated. This way, we unwind
back to the explicit initializer list properly rather than getting
stuck in the wrong subobject. Fixes llvm.org/PR3519



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
9fdddeddf7db0becc807298410fa5da31063e525 29-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
f36b49300c3dba9d544171bd4f81d40afc451a74 29-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Add another devilish testcase for designated initializers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
36859ebc8a597bd07f9645684f4d361c918e0859 29-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate infinite looping in a wacky case with designated initializers. Simplifies (somewhat) the actually checking of the initializer expression following the designators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
36dd0c55546d02d19186caf889230755776d0601 29-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Improvements to code-generation and semantic analysis of designated
initializers.

- We now initialize unions properly when a member other than the
first is named by a designated initializer.
- We now provide proper semantic analysis and code generation for
GNU array-range designators *except* that side effects will occur
more than once. We warn about this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
f603b47aec06841368ddb1a36925c57976794c24 28-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> 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)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
ea0528d8f4dd6604f8ad29b0eb591c8243c2d8aa 23-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> More APSInt appeasement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
e498e37015d2eef11cf92659006cbd394759c3c0 23-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Hopefully the last of the APSInt signedness issues with initializers. Fixes PR clang/3378

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
6972270a30303957eaf47a7170f58a7140a78de7 23-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure all of the isUnsigned flags line up when comparing initializer values, to really really fix PR clang/3377

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
5a203a607869f30926d8614da04ab53a4e4834f2 23-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Properly manage the bit-widths of APInts/APSInts in array initialization.
Fixes PR clang/3377


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
710f6d41708bc34c39b75a00d9cc91cee68cf4d8 23-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Reimplement the handling of the "current object" in designator
initializers, so that we are within the appropriate subobject after
we've processed a multi-designator designation. We're matching GCC and
EDG's behavior on all examples I've found thus far.

*Huge* thanks to Eli Friedman for pointing out my fundamental
misunderstanding of "current object" in the C99 spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c
c5a6bdc2f783e75a434e1e230dac17b946822976 22-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> 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.

There are still some wrinkles with GNU's anonymous structs and
anonymous unions (it isn't clear how these should work; we'll just
follow GCC's lead) and with designated initializers for the members of a
union. I'll tackle those very soon.

CodeGen is still nonexistent, and there's some leftover code in the
parser's representation of designators that I'll also need to clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/designated-initializers.c