Question on llc output stream

In llc's GetOutputStream we have this:

    raw_fd_ostream *FDOut = new raw_fd_ostream(OutputFilename.c_str(),
                                               /*Binary=*/true, Force, error);

Why is Binary set true here? We don't know yet whether this is going to be an
AsmFile or a MachOFile.

Setting Binary=true causes the stream to be unbuffered. Is this what we want?

                               -Dave

In llc's GetOutputStream we have this:

   raw_fd_ostream *FDOut = new raw_fd_ostream(OutputFilename.c_str(),
                                              /*Binary=*/true, Force, error);

Why is Binary set true here? We don't know yet whether this is going to be an
AsmFile or a MachOFile.

Looks like a bug. It looks like there are two copies of that code, one for the
case where there's an explicit OutputFilename, and one where there isn't one,
right below it. Only the second one sets the Binary flag properly.

Setting Binary=true causes the stream to be unbuffered. Is this what we want?

I don't see where this happens. In any case, no, Binary streams should still be buffered.

Dan

I was wrong. I was tracking down a bug related to buffering and missed a
place in the code where the buffer gets set up.

                                 -Dave