Skip to content

Commit 625f08d

Browse files
committed
[SystemZ][z/OS] Set text flag correctly for llvm-reduce tool
This patch sets the text flag correctly for llvm-reduce files Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D138304
1 parent 841a0ed commit 625f08d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

llvm/tools/llvm-reduce/TestRunner.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ void writeBitcode(ReducerWorkItem &M, raw_ostream &OutStream) {
9797

9898
void TestRunner::writeOutput(StringRef Message) {
9999
std::error_code EC;
100-
raw_fd_ostream Out(OutputFilename, EC);
100+
raw_fd_ostream Out(OutputFilename, EC,
101+
EmitBitcode && !Program->isMIR() ? sys::fs::OF_None
102+
: sys::fs::OF_Text);
101103
if (EC) {
102104
errs() << "Error opening output file: " << EC.message() << "!\n";
103105
exit(1);

llvm/tools/llvm-reduce/deltas/Delta.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ bool isReduced(ReducerWorkItem &M, TestRunner &Test) {
7474
int FD;
7575
std::error_code EC = sys::fs::createTemporaryFile(
7676
"llvm-reduce", M.isMIR() ? "mir" : (UseBitcode ? "bc" : "ll"), FD,
77-
CurrentFilepath);
77+
CurrentFilepath,
78+
UseBitcode && !M.isMIR() ? sys::fs::OF_None : sys::fs::OF_Text);
7879
if (EC) {
7980
errs() << "Error making unique filename: " << EC.message() << "!\n";
8081
exit(1);

0 commit comments

Comments
 (0)