<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 17, 2010, at 12:37 PM, Talin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Feb 17, 2010 at 12:05 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><br>
On Feb 16, 2010, at 12:38 PM, Talin wrote:<br>
<br>
> Here's the implementation of ConstantUnion::replaceUsesOfWithOnConstant(). No tests yet :(<br>
<br>
</div>Seems basically ok, please commit.<br>
<div class="im"><br></div></blockquote><div>I suppose that means that I'll have to send in the info to get commit access then :(</div></div></blockquote><div><br></div>Yep, plz do.</div><div><br></div><div><br></div><div><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">IS this what is causing this to be broken?<br></blockquote><div><br></div><div>No no, nothing's broken. I just wanted to write some tests for the replaceAllUsesOf case, and wondered if there was an existing test to use as a model. </div></div></blockquote><div><br></div><div>I'm pointing out that the test doesn't work with mainline, and was hoping that your patch fixes it.</div><br><blockquote type="cite"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<br>
$ cat t.ll<br>
@union1 = constant union { i32*, i8 } { i32* @G }<br>
@G = global i32 4<br>
$ llvm-as <t.ll | llvm-dis<br>
; ModuleID = '<stdin>'<br>
<br>
@union1 = constant union { i32*, i8 } undef       ; <union { i32*, i8 }*> [#uses=0]<br>
@G = global i32 4<br>
<div class="im"><br>
> -- I could also use some advice on what part of the code to work on next (in terms of finishing up union support).<br>
<br>
</div>What is missing?<br>
<font color="#888888"><br></font></blockquote><div>Almost everything :) At this point, the only parts of the code that are aware of unions are:</div><div><ul><li>Derived type definitions (Type.cpp and so on)</li><li>BitReader and BitWriter.</li>

<li>LLParser.</li><li>Constants.</li></ul><div>There's no code that calculates the offsets of the union fields for example. None of the code generators know about unions yet.</div><div><br></div><div>That's why I was wondering what area to work on next - I'm unfamiliar with the code and could use a few hints :)</div>

</div></div></blockquote></div><br><div>Making TargetData's handle it would make sense which will teach various GEP iteration stuff about unions.  After that I'd try sending various union cases through the code generator to expose the obvious issues there.</div><div><br></div><div>-Chris</div></body></html>