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

Abhina Sree via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 12:33:31 PDT 2021


abhina.sreeskantharajan added a comment.

In D99426#2656582 <https://reviews.llvm.org/D99426#2656582>, @MaskRay wrote:

> 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.
>
> OK.
>
>> 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,

Sorry for causing confusion. CRLF in text files is a Windows-only problem, it doesn't affect z/OS. On z/OS we only need text files to be marked accurately as text. I updated the description and comments in FileSystem.h to be more clear.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99426/new/

https://reviews.llvm.org/D99426



More information about the llvm-commits mailing list