[llvm] [SystemZ][z/OS] Query if a file is text and set the text flag accordingly (PR #109664)
Sean Perry via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 11:58:44 PDT 2024
https://github.com/perry-ca requested changes to this pull request.
We can't use the actual file to determine if it should be read as text or binary. The context of where the file is being read determines if we need to treat it as a text file, not the file being read. I think one example is the `#embed` directive. The `#embed` is a binary file inclusion. If the file is a text file we need to embed the original bytes from the file (i.e. as binary). If we check the file, see it is text and then do a code page conversion when reading the file as text, we will include the wrong values into the program. The call to open the file has to say if it is text or binary.
https://github.com/llvm/llvm-project/pull/109664
More information about the llvm-commits
mailing list