[Windows] Remove global OF_None flag for Windows in ToolOutputFiles
authorAbhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com>
Wed, 7 Apr 2021 18:09:21 +0000 (14:09 -0400)
committerAbhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com>
Wed, 7 Apr 2021 18:10:04 +0000 (14:10 -0400)
Since we have created a new OF_TextWithCRLF flag, we no longer need to worry about OF_Text flag turning on CRLF translation. I can remove this workaround I added to globally open all ToolOutputFiles as binary on Windows.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D100034

llvm/lib/Support/ToolOutputFile.cpp

index 3735aac..c192ce6 100644 (file)
@@ -46,12 +46,7 @@ ToolOutputFile::ToolOutputFile(StringRef Filename, std::error_code &EC,
     EC = std::error_code();
     return;
   }
-
-  // On Windows, we set the OF_None flag even for text files to avoid
-  // CRLF translation.
-  OSHolder.emplace(
-      Filename, EC,
-      llvm::Triple(LLVM_HOST_TRIPLE).isOSWindows() ? sys::fs::OF_None : Flags);
+  OSHolder.emplace(Filename, EC, Flags);
   OS = OSHolder.getPointer();
   // If open fails, no cleanup is needed.
   if (EC)