diff options
author | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2021-06-08 14:44:45 -0400 |
---|---|---|
committer | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2021-06-08 14:45:34 -0400 |
commit | 0e8506debae3ad534b4eecfa922fc6281506a635 (patch) | |
tree | 05ece4775181293c0f994381f2702e6fe073d9f0 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 31a9659de550b25b6bc0ad5cab73d133095c351f (diff) | |
download | llvm-0e8506debae3ad534b4eecfa922fc6281506a635.zip llvm-0e8506debae3ad534b4eecfa922fc6281506a635.tar.gz llvm-0e8506debae3ad534b4eecfa922fc6281506a635.tar.bz2 |
[SystemZ][z/OS] Pass OpenFlags when creating tmp files
This patch https://reviews.llvm.org/D102876 caused some lit regressions on z/OS because tmp files were no longer being opened based on binary/text mode. This patch passes OpenFlags when creating tmp files so we can open files in different modes.
Reviewed By: amccarth
Differential Revision: https://reviews.llvm.org/D103806
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 32e7fdf..a70fe95 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -828,7 +828,9 @@ CompilerInstance::createOutputFileImpl(StringRef OutputPath, bool Binary, TempPath += OutputExtension; TempPath += ".tmp"; Expected<llvm::sys::fs::TempFile> ExpectedFile = - llvm::sys::fs::TempFile::create(TempPath); + llvm::sys::fs::TempFile::create( + TempPath, llvm::sys::fs::all_read | llvm::sys::fs::all_write, + Binary ? llvm::sys::fs::OF_None : llvm::sys::fs::OF_Text); llvm::Error E = handleErrors( ExpectedFile.takeError(), [&](const llvm::ECError &E) -> llvm::Error { |