diff options
author | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2021-03-19 08:09:01 -0400 |
---|---|---|
committer | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2021-03-19 08:09:57 -0400 |
commit | 4f750f6ebc412869ce6bb28331313a9c9a9d9af7 (patch) | |
tree | 537fc11c22134d3d9700fffe1d2e030d8a470d9a /clang/lib/Frontend/CompilerInstance.cpp | |
parent | c2313a45307e807a6ee08d3b32cf6e4d099849a6 (diff) | |
download | llvm-4f750f6ebc412869ce6bb28331313a9c9a9d9af7.zip llvm-4f750f6ebc412869ce6bb28331313a9c9a9d9af7.tar.gz llvm-4f750f6ebc412869ce6bb28331313a9c9a9d9af7.tar.bz2 |
[SystemZ][z/OS] Distinguish between text and binary files on z/OS
This patch consists of the initial changes to help distinguish between text and binary content correctly on z/OS. I would like to get feedback from Windows users on setting OF_None for all ToolOutputFiles. This seems to have been done as an optimization to prevent CRLF translation on Windows in the past.
Reviewed By: zibi
Differential Revision: https://reviews.llvm.org/D97785
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index d40240b..284b20c 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -814,15 +814,18 @@ CompilerInstance::createOutputFileImpl(StringRef OutputPath, bool Binary, TempPath += OutputExtension; TempPath += ".tmp"; int fd; - std::error_code EC = - llvm::sys::fs::createUniqueFile(TempPath, fd, TempPath); + std::error_code EC = llvm::sys::fs::createUniqueFile( + TempPath, fd, TempPath, + Binary ? llvm::sys::fs::OF_None : llvm::sys::fs::OF_Text); if (CreateMissingDirectories && EC == llvm::errc::no_such_file_or_directory) { StringRef Parent = llvm::sys::path::parent_path(OutputPath); EC = llvm::sys::fs::create_directories(Parent); if (!EC) { - EC = llvm::sys::fs::createUniqueFile(TempPath, fd, TempPath); + EC = llvm::sys::fs::createUniqueFile(TempPath, fd, TempPath, + Binary ? llvm::sys::fs::OF_None + : llvm::sys::fs::OF_Text); } } |