Skip to content

Commit 0de1e3e

Browse files
authored
[;SystemZ][z/OS] Fix llvm-ctxprof to open input files in text mode (#109691)
Reading text files on z/OS relies on auto conversion to handle ASCII/EBCDIC correctly. For this to work files need to be opened in text mode is that is the type of the file. This PR fixes `llvm-ctxprof` utility in this regards which in turn fixes the following LIT failure on z/OS: `FAIL: LLVM :: Analysis/CtxProfAnalysis/flatten-zero-path.ll`
1 parent fe7bc87 commit 0de1e3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ static cl::opt<std::string> OutputFilename("output", cl::value_desc("output"),
4848

4949
// Save the bitstream profile from the JSON representation.
5050
Error convertFromJSON() {
51-
auto BufOrError = MemoryBuffer::getFileOrSTDIN(InputFilename);
51+
auto BufOrError =
52+
MemoryBuffer::getFileOrSTDIN(InputFilename, /*IsText=*/true);
5253
if (!BufOrError)
5354
return createFileError(InputFilename, BufOrError.getError());
5455

0 commit comments

Comments
 (0)