<div>Chris,</div><div><br></div><div>That's an easy to change to make. The bulk of the patch is not about the flag, but about transforming __builtin_va_arg to VAArgInst.</div><div><br></div><div>However, as far as I know, there are no targets for which the backend va_arg implementation is production-worthy. Currently, Clang has custom va_arg emission for X86-32, X86-64, PIC16, and ARM, while llvm-gcc never emits the va_arg instruction. As a result, va_arg on most targets is still untested and potentially incomplete. (I don't think structure passing works on any targets).</div>
<div><div><br></div></div><div><div>The flag will help facilitate testing of the backend va_arg implementations, especially X86-64.</div><div><br></div></div><div>(FYI, I have also submitted an initial X86-64 va_arg implementation for review. This implementation is not complete, but it works for the basic types. See <a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20101004/109404.html">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20101004/109404.html</a>). In comparison, the complete implementation of X86-64 va_arg in Clang is 1300 lines.</div>
<div><br></div><div>Thanks,</div><div><div></div></div><div>- David M</div><div><br></div><br><div class="gmail_quote">On Mon, Oct 11, 2010 at 4:11 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div><div><br><div><div>On Oct 11, 2010, at 7:44 AM, David Meyer wrote:</div>

<br><blockquote type="cite">I discovered I was missing some #ifdef's.<div><br></div><div>New patch is attached.</div><div><br></div><div>Updated visual at: <a href="http://codereview.chromium.org/3694002/show" target="_blank">http://codereview.chromium.org/3694002/show</a></div>


</blockquote><br></div></div></div><div>Hi David,</div><div><br></div><div>I haven't looked at the patch, but I'm not in favor of this.  Having llvm-gcc generate the va_arg instruction (on targets where it works) is goodness, but we shouldn't add a user-visible knob for it.  We should just *always* generate it on those targets.</div>

<div><br></div><font color="#888888"><div>-Chris</div><br></font></div></blockquote></div><br>