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
On Jul 29, 2009, at 8:09 AM, David Greene wrote:> 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
On Wednesday 29 July 2009 10:34, Dan Gohman wrote:> > 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.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