[clang] [llvm] [z/OS] treat text files as text files so auto-conversion is done (PR #90128)

Sean Perry via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 12:50:09 PDT 2024


================
@@ -413,8 +413,9 @@ static bool format(StringRef FileName, bool ErrorOnIncompleteFormat = false) {
   // On Windows, overwriting a file with an open file mapping doesn't work,
   // so read the whole file into memory when formatting in-place.
   ErrorOr<std::unique_ptr<MemoryBuffer>> CodeOrErr =
-      !OutputXML && Inplace ? MemoryBuffer::getFileAsStream(FileName)
-                            : MemoryBuffer::getFileOrSTDIN(FileName);
+      !OutputXML && Inplace
+          ? MemoryBuffer::getFileAsStream(FileName)
+          : MemoryBuffer::getFileOrSTDIN(FileName, /*IsText=*/true);
----------------
perry-ca wrote:

I don't believe this will be a problem for Windows.  This is a common problem that we have fixed in a few places already.  I don't have a Windows platform to confirm.  Would you or someone else be able to verify?

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


More information about the llvm-commits mailing list