[Lldb-commits] [PATCH] D99426: [Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text

Fangrui Song via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 29 11:51:45 PDT 2021

MaskRay added a comment.

In D99426#2656217 <https://reviews.llvm.org/D99426#2656217>, @rnk wrote:

> In D99426#2653725 <https://reviews.llvm.org/D99426#2653725>, @MaskRay wrote:
>> This touches a lot of files. I am a bit worried that it would not be easy for a contributor to know OF_TextWithCRLF is needed to make SystemZ happy.
> Right, we need to separate text-ness for System/Z EBCDIC re-encoding from Windows CRLF translation. I think it's best to have a separate, positive CRLF bit, and to make that spelling longer than OF_Text. I think, in general, more problems are caused by extra unintended CRLF than by missing carriage returns.


> OF_CRLF which indicates that CRLF translation is used.
> OF_TextWithCRLF = OF_Text | OF_CRLF indicates that the file is text and uses CRLF translation.

My confusion came from I do not know what "CRLF translation" in the description refers to. So it seems like EBCDIC->ASCII translation for CRLF? I thought it was related to Windows.

The current comment in the source code should be clarified too:

  /// The file should be opened with CRLF translation on platforms that
  /// make this distinction.
  OF_CRLF = 2,
  OF_TextWithCRLF = 3,

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list