[clang] [clang-tools-extra] [lldb] [llvm] Propagate IsText parameter to openFileForRead function (PR #110661)

Abhina Sree via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 10:32:52 PDT 2024


abhina-sree wrote:

> The default is set to OF_Text instead of OF_None, this change in value does not affect any other platforms other than z/OS. Setting this parameter correctly is required to open files on z/OS in the correct encoding. The IsText parameter is based on the context of where we open files, for example, the embed directive requires that files always be opened in binary even though they might be tagged as text.

Thanks for your patience. I've put up this PR https://github.com/llvm/llvm-project/pull/111723 to implement your suggestion. I kept the IsText parameter in the getBufferForFile, getBufferForFileImpl because it already has other attributes like IsVolatile, RequiresNullTerminator but created a new virtual function for openFileForReadBinary which greatly reduces the number of files touched compared to this PR. The current `#embed` lit tests seem to work without additional changes but I will experiment with creating a testcase with inputs that are non-ascii to expose any issues

https://github.com/llvm/llvm-project/pull/110661


More information about the cfe-commits mailing list