[llvm] [SystemZ][z/OS] Query if a file is text and set the text flag accordingly (PR #109664)
kadir çetinkaya via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 07:22:43 PDT 2024
================
@@ -325,8 +325,15 @@ ErrorOr<Status> RealFileSystem::status(const Twine &Path) {
ErrorOr<std::unique_ptr<File>>
RealFileSystem::openFileForRead(const Twine &Name) {
SmallString<256> RealName, Storage;
+ auto OpenFlags = sys::fs::OF_None;
+#ifdef __MVS__
+ // If the file is tagged with a text ccsid, it may require autoconversion.
----------------
kadircet wrote:
so as discussed in https://github.com/llvm/llvm-project/pull/107906 (mostly leaving it for context of future travelers); it's still unclear to me why we need to perform this check only at this point (and not other places that reads files, e.g. deep down the system helper stack).
Can you expand the comments here a little bit? At high level it's not obvious what an `autoconversion` is and why it's needed. I think mentioning that in here would make it easier for maintenance going forward, since most people that touch this code, won't know about zOS.
https://github.com/llvm/llvm-project/pull/109664
More information about the llvm-commits
mailing list