[PATCH] D138304: [SystemZ][z/OS] Set text flag correctly for llvm-reduce tool
Abhina Sree via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 18 08:18:18 PST 2022
abhina.sreeskantharajan created this revision.
Herald added a project: All.
abhina.sreeskantharajan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch sets the text flag correctly for llvm-reduce files
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D138304
Files:
llvm/tools/llvm-reduce/TestRunner.cpp
llvm/tools/llvm-reduce/deltas/Delta.cpp
Index: llvm/tools/llvm-reduce/deltas/Delta.cpp
===================================================================
--- llvm/tools/llvm-reduce/deltas/Delta.cpp
+++ llvm/tools/llvm-reduce/deltas/Delta.cpp
@@ -74,7 +74,8 @@
int FD;
std::error_code EC = sys::fs::createTemporaryFile(
"llvm-reduce", M.isMIR() ? "mir" : (UseBitcode ? "bc" : "ll"), FD,
- CurrentFilepath);
+ CurrentFilepath,
+ UseBitcode && !M.isMIR() ? sys::fs::OF_None : sys::fs::OF_Text);
if (EC) {
errs() << "Error making unique filename: " << EC.message() << "!\n";
exit(1);
Index: llvm/tools/llvm-reduce/TestRunner.cpp
===================================================================
--- llvm/tools/llvm-reduce/TestRunner.cpp
+++ llvm/tools/llvm-reduce/TestRunner.cpp
@@ -97,7 +97,9 @@
void TestRunner::writeOutput(StringRef Message) {
std::error_code EC;
- raw_fd_ostream Out(OutputFilename, EC);
+ raw_fd_ostream Out(OutputFilename, EC,
+ EmitBitcode && !Program->isMIR() ? sys::fs::OF_None
+ : sys::fs::OF_Text);
if (EC) {
errs() << "Error opening output file: " << EC.message() << "!\n";
exit(1);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138304.476488.patch
Type: text/x-patch
Size: 1206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221118/3760e03b/attachment.bin>
More information about the llvm-commits
mailing list