[llvm-commits] RFC: initial union syntax support

Andrew Lenharth andrewl at lenharth.org
Thu May 14 04:49:21 PDT 2009


On Thu, May 14, 2009 at 3:18 AM, Gabor Greif <ggreif at gmail.com> wrote:
> There must be a proper equivalence relation with a sane
> semantics defined on unions before this can work.
> Andrew, can you provide such a definition?

Why?  I don't see why union {i32, i32} should be disallowed nor union
{i32} should be equivalent to it.

> LLVM types are uniqued, so the underlying machinery
> already expects this.

union types are uniqued in the same way struct types are.  And they
are done so by logical fields since I think that is the only sane way
to allow a front end to construct a union and use GEPs to get the
correct type out of it.

>
> Cheers,
>
>    Gabor
>
>
> On May 14, 8:46 am, me22 <me22... at gmail.com> wrote:
>> On Wed, May 13, 2009 at 02:19, Nick Lewycky <nicho... at mxc.ca> wrote:
>>
>> > For that matter, I just realized after sending that <union {i8, i9}> and
>> > <union {i9, i8}> must be the same type.
>>
>> If union {i8, i32} and union {i32, i8} are the same type, how does GEP
>> know which type to return for a given index?
>>
>> Scott
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> 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