<div dir="ltr">On Wed, Jun 19, 2013 at 1:19 PM, Charles Davis <span dir="ltr"><<a href="mailto:cdavis5x@gmail.com" target="_blank">cdavis5x@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5"><br>
On Jun 19, 2013, at 9:09 AM, Reid Kleckner wrote:<br>
<br>
> Author: rnk<br>
> Date: Wed Jun 19 10:09:06 2013<br>
> New Revision: 184308<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=184308&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=184308&view=rev</a><br>
> Log:<br>
> [Driver] Don't forward source file input args to gcc<br>
><br>
> gcc's inputs are already added by the InputInfoList passed to<br>
> Action::ConstructJob.<br>
><br>
> Fixes a regression from r183989.  This was manifesting when targetting<br>
> mingw as an extra input argument to gcc when assembling.  It presumably<br>
> affects other situations where clang calls gcc.<br>
><br>
> Prior to r183989, forwardToGCC() was returning false because the INPUT<br>
> option defined in OptParser.td had the DriverOption flag set on it.<br>
> LLVM's Option library does not set this flag for INPUT.<br>
><br>
> Reviewers: espindola<br>
><br>
> Differential Revision: <a href="http://llvm-reviews.chandlerc.com/D999" target="_blank">http://llvm-reviews.chandlerc.com/D999</a><br>
><br>
> Modified:<br>
>    cfe/trunk/lib/Driver/Tools.cpp<br>
>    cfe/trunk/test/Driver/no-integrated-as-win.c<br>
><br>
> Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=184308&r1=184307&r2=184308&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=184308&r1=184307&r2=184308&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/Tools.cpp Wed Jun 19 10:09:06 2013<br>
> @@ -225,7 +225,10 @@ static void addProfileRT(const ToolChain<br>
> }<br>
><br>
> static bool forwardToGCC(const Option &O) {<br>
> -  return !O.hasFlag(options::NoForward) &&<br>
> +  // Don't forward inputs from the original command line.  They are added from<br>
> +  // InputInfoList.<br>
> +  return !O.getKind() == Option::InputClass &&<br>
</div></div>Did you mean:<br>
<br>
  return O.getKind() != Option::InputClass &&<br>
                     ^<br>
<br>
? Am I the only one who noticed this?</blockquote><div><br></div><div>No, someone else mailed me about this off list.  If someone can fix it quick, please do, it's not convenient for me right now.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
How are the tests even passing with this?</blockquote><div><br></div><div style>There's only one driver test that exercises this, which I just added.  It's loose because I was trying to solve a problem of too many args, not too few.  I can beef it up tomorrow.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">And why didn't Clang warn on this for you? (Want me to file a bug?)</blockquote>
<div><br></div><div style>As Matt said, we have the warning, but it must not be on.  I don't have clang self-hosting on Windows, but a bot could've told me about it.</div></div></div></div>