[llvm-commits] [llvm-gcc-4.2] r126672 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Tue Mar 1 01:01:55 PST 2011


Hi Stuart,

> Skip anonymous union fields when initializing.  Radar 9055247.

please add a testcase.

> -  // Unions are initialized using the first member field.  Find it.
> +  // Unions are initialized using the first non-anonymous member field.  Find it.

I'm curious to know what this is based on?  Does the C standard say this?

Thanks, Duncan.

>     tree Field = TYPE_FIELDS(TREE_TYPE(exp));
>     assert(Field&&  "cannot initialize union with no fields");
> -  while (TREE_CODE(Field) != FIELD_DECL) {
> +  while (TREE_CODE(Field) != FIELD_DECL || DECL_NAME(Field) == NULL_TREE) {
>       Field = TREE_CHAIN(Field);
>       assert(Field&&  "cannot initialize union with no fields");
>     }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list