ygao added a comment.

If you take a look at

  void PrintPreprocessedAction::ExecuteAction() {
        ...
        while (next < end) {
        if (*cur == 0x0D) {  // CR
          if (*next == 0x0A)  // CRLF
            BinaryMode = false;
        ...

The value of this BinaryMode reflects whether the line ending style of the 
input file
is CRLF or LF. And it is passed all the way down to the constructor of 
raw_fd_ostream,

  std::unique_ptr<llvm::raw_pwrite_stream> 
CompilerInstance::createOutputFile(...) {
      ...
    if (!Binary || OS->supportsSeeking())
      return std::move(OS);
  
    auto B = llvm::make_unique<llvm::buffer_ostream>(*OS);
    ...

So I think the line ending style of the input file does affect whether the 
output is buffered.


http://reviews.llvm.org/D15705



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to