[Lldb-commits] [clang] [clang-tools-extra] [lldb] [llvm] [SystemZ][z/OS] Propagate IsText parameter to open text files as text (PR #107906)

kadir çetinkaya via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 23 01:21:49 PDT 2024


kadircet wrote:

i think limiting this to `RealFileSystem::openFileForRead` LG, but can we make sure `IsText` defaults to `false` and we can only set it in `#ifdef __MVS__` block to make sure this is really a no-op for other platforms. e.g.:
```cppp
auto OpenFlags = sys::fs::OF_None;
#ifdef __MVS__
....
  OpenFlags |= sys::fs::OF_Text;
....
#endif
   Expected<file_t> FDOrErr = sys::fs::openNativeFileForRead(
      adjustPath(Name, Storage), OpenFlags, &RealName);
```

I'd still prefer doing this inside https://github.com/llvm/llvm-project/blob/main/llvm/lib/Support/Unix/Path.inc#L972-L1118 as we have other utility functions that create file-descriptors and all of them end up using these base functions. By having your logic at a layer above these, you risk having subtle discrepancies. But I don't know much about zOS or why this is needed, so I'll leave management of that risk to you.

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


More information about the lldb-commits mailing list