<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 13, 2010, at 12:11 PM, Talin wrote:</div><blockquote type="cite"><div class="gmail_quote"><div><font class="Apple-style-span" color="#000000"><br></font></div><div>It depends on whether or not unions can be passed around as SSA values or not. I can think of situations where you would want to.</div><div><br></div> <div>In particular, GEP is useful because you can avoid the bitcast above - GEP to element 0 if you want an int (in the example above), or to element 1 if you want a double.</div><div><br></div><div>Also, I'm thinking that insertvalue might be the best way to construct a constant union. Right now there's a bit of a problem in that the data type of a constant must match exactly the declared type; However in the case of a union what we want is for the data type of the initializer to exactly match the type of one of the union members. I thought this would be relatively easy to do, but it's a little trickier than I realized.</div> </div></blockquote></div><br><div>I think it is useful to support insert/extract on unions just for orthogonality alone. Stuff that works on structs should generally work on unions too.</div><div><br></div><div>-Chris</div></body></html>