From 5c8462b5daa2a17eadf5e9f6b976452369aa3a93 Mon Sep 17 00:00:00 2001 From: Abhina Sreeskantharajan Date: Wed, 7 Apr 2021 14:09:21 -0400 Subject: [PATCH] [Windows] Remove global OF_None flag for Windows in ToolOutputFiles 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 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/llvm/lib/Support/ToolOutputFile.cpp b/llvm/lib/Support/ToolOutputFile.cpp index 3735aac..c192ce6 100644 --- a/llvm/lib/Support/ToolOutputFile.cpp +++ b/llvm/lib/Support/ToolOutputFile.cpp @@ -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) -- 2.7.4