aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
authorAbhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com>2021-03-19 08:09:01 -0400
committerAbhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com>2021-03-19 08:09:57 -0400
commit4f750f6ebc412869ce6bb28331313a9c9a9d9af7 (patch)
tree537fc11c22134d3d9700fffe1d2e030d8a470d9a /llvm/utils/FileCheck/FileCheck.cpp
parentc2313a45307e807a6ee08d3b32cf6e4d099849a6 (diff)
downloadllvm-4f750f6ebc412869ce6bb28331313a9c9a9d9af7.zip
llvm-4f750f6ebc412869ce6bb28331313a9c9a9d9af7.tar.gz
llvm-4f750f6ebc412869ce6bb28331313a9c9a9d9af7.tar.bz2
[SystemZ][z/OS] Distinguish between text and binary files on z/OS
This patch consists of the initial changes to help distinguish between text and binary content correctly on z/OS. I would like to get feedback from Windows users on setting OF_None for all ToolOutputFiles. This seems to have been done as an optimization to prevent CRLF translation on Windows in the past. Reviewed By: zibi Differential Revision: https://reviews.llvm.org/D97785
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
-rw-r--r--llvm/utils/FileCheck/FileCheck.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 668dd98..0ee105d 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -821,7 +821,9 @@ int main(int argc, char **argv) {
// Read the expected strings from the check file.
ErrorOr<std::unique_ptr<MemoryBuffer>> CheckFileOrErr =
- MemoryBuffer::getFileOrSTDIN(CheckFilename);
+ MemoryBuffer::getFileOrSTDIN(CheckFilename, /*FileSize*/ -1,
+ /*RequiresNullTerminator*/ true,
+ /*IsText*/ true);
if (std::error_code EC = CheckFileOrErr.getError()) {
errs() << "Could not open check file '" << CheckFilename
<< "': " << EC.message() << '\n';
@@ -843,7 +845,9 @@ int main(int argc, char **argv) {
// Open the file to check and add it to SourceMgr.
ErrorOr<std::unique_ptr<MemoryBuffer>> InputFileOrErr =
- MemoryBuffer::getFileOrSTDIN(InputFilename);
+ MemoryBuffer::getFileOrSTDIN(InputFilename, /*FileSize*/ -1,
+ /*RequiresNullTerminator*/ true,
+ /*IsText*/ true);
if (InputFilename == "-")
InputFilename = "<stdin>"; // Overwrite for improved diagnostic messages
if (std::error_code EC = InputFileOrErr.getError()) {