aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorAbhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com>2021-06-08 14:44:45 -0400
committerAbhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com>2021-06-08 14:45:34 -0400
commit0e8506debae3ad534b4eecfa922fc6281506a635 (patch)
tree05ece4775181293c0f994381f2702e6fe073d9f0 /llvm/lib/Support/Path.cpp
parent31a9659de550b25b6bc0ad5cab73d133095c351f (diff)
downloadllvm-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 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index d549b00..a724ba2 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -1288,11 +1288,12 @@ Error TempFile::keep() {
return Error::success();
}
-Expected<TempFile> TempFile::create(const Twine &Model, unsigned Mode) {
+Expected<TempFile> TempFile::create(const Twine &Model, unsigned Mode,
+ OpenFlags ExtraFlags) {
int FD;
SmallString<128> ResultPath;
if (std::error_code EC =
- createUniqueFile(Model, FD, ResultPath, OF_Delete, Mode))
+ createUniqueFile(Model, FD, ResultPath, OF_Delete | ExtraFlags, Mode))
return errorCodeToError(EC);
TempFile Ret(ResultPath, FD);