Hi Julien,<div><br></div><div>Sorry, I didn't think about this case. r58042 is a fix I believe, can you confirm?</div><div><br></div><div> - Daniel<br><br><div class="gmail_quote">On Thu, Oct 23, 2008 at 9:22 AM, Julien Lerouge <span dir="ltr"><<a href="mailto:jlerouge@apple.com">jlerouge@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On Wed, Oct 22, 2008 at 05:39:14PM +0000, Daniel Dunbar wrote:<br>
> ...<br>
<div class="Ih2E3d">><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)<br>
> +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Wed Oct 22 12:39:14 2008<br>
</div><div class="Ih2E3d">> @@ -1356,7 +1364,7 @@<br>
><br>
><br>
>    // If writing to stdout, set binary mode.<br>
> -  if (llvm::cout == Out)<br>
> +  if (&llvm::outs() == &Out)<br>
>      sys::Program::ChangeStdoutToBinary();<br>
><br>
>    // Write the generated bitstream to "Out".<br>
><br>
</div>> ...<br>
><br>
<br>
This breaks stdout output on MingW if using the old WriteBitcodeToFile<br>
API. In that case, the test doesn't work because it's comparing the<br>
address of the raw_stdout_ostream static with the address of a local<br>
object (allocated in the older API).<br>
<br>
In the older API, can you add a test for cout and return the same static<br>
if writing to stdout ? Or directly call ChangeStdoutToBinary in the<br>
older API if llvm::cout == Out ?<br>
<br>
Thanks,<br>
Julien<br>
<br>
MW $ llvm-as -f foo.ll > foo.bc<br>
MW $ llvm-dis -f foo.bc<br>
C:\llvm\bin\llvm-dis: Invalid bitcode signature<br>
MW $<br>
<br>
but:<br>
<br>
MW $ llvm-as -f foo.ll -o foo.bc<br>
MW $ llvm-dis -f foo.bc<br>
MW $<br>
<font color="#888888"><br>
--<br>
Julien Lerouge<br>
PGP Key Id: 0xB1964A62<br>
PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62<br>
PGP Public Key from: <a href="http://keyserver.pgp.com" target="_blank">keyserver.pgp.com</a><br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>