[llvm-commits] [llvm] r57989 - in /llvm/trunk: include/llvm/Bitcode/ReaderWriter.h lib/Bitcode/Writer/BitcodeWriter.cpp lib/Bitcode/Writer/BitcodeWriterPass.cpp

Daniel Dunbar daniel at zuster.org
Thu Oct 23 12:39:15 PDT 2008


Hi Julien,
Sorry, I didn't think about this case. r58042 is a fix I believe, can you
confirm?

 - Daniel

On Thu, Oct 23, 2008 at 9:22 AM, Julien Lerouge <jlerouge at apple.com> wrote:

> On Wed, Oct 22, 2008 at 05:39:14PM +0000, Daniel Dunbar wrote:
> > ...
> >
> >
> ==============================================================================
> > --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
> > +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Wed Oct 22 12:39:14
> 2008
> > @@ -1356,7 +1364,7 @@
> >
> >
> >    // If writing to stdout, set binary mode.
> > -  if (llvm::cout == Out)
> > +  if (&llvm::outs() == &Out)
> >      sys::Program::ChangeStdoutToBinary();
> >
> >    // Write the generated bitstream to "Out".
> >
> > ...
> >
>
> This breaks stdout output on MingW if using the old WriteBitcodeToFile
> API. In that case, the test doesn't work because it's comparing the
> address of the raw_stdout_ostream static with the address of a local
> object (allocated in the older API).
>
> In the older API, can you add a test for cout and return the same static
> if writing to stdout ? Or directly call ChangeStdoutToBinary in the
> older API if llvm::cout == Out ?
>
> Thanks,
> Julien
>
> MW $ llvm-as -f foo.ll > foo.bc
> MW $ llvm-dis -f foo.bc
> C:\llvm\bin\llvm-dis: Invalid bitcode signature
> MW $
>
> but:
>
> MW $ llvm-as -f foo.ll -o foo.bc
> MW $ llvm-dis -f foo.bc
> MW $
>
> --
> Julien Lerouge
> PGP Key Id: 0xB1964A62
> PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62
> PGP Public Key from: keyserver.pgp.com
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081023/c08b76f6/attachment.html>


More information about the llvm-commits mailing list