From e22ce615fe31a78857a8574c12a32bddc6da465e Mon Sep 17 00:00:00 2001 From: Sean Perry <39927768+perry-ca@users.noreply.github.com> Date: Wed, 1 May 2024 10:39:41 -0400 Subject: [z/OS] treat text files as text files so auto-conversion is done (#90128) To support auto-conversion on z/OS text files need to be opened as text files. These changes will fix a number of LIT failures due to text files not being converted to the internal code page. update a number of tools so they open the text files as text files add support in the cat.py to open a text file as a text file (Windows will continue to treat all files as binary so new lines are handled correctly) add env var definitions to enable auto-conversion in the lit config file. --- llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp') diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp index c3015d8..40ee59c 100644 --- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp +++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp @@ -95,7 +95,8 @@ static std::vector getSearchPaths(opt::InputArgList *Args, // Opens a file. Path has to be resolved already. (used for def file) std::unique_ptr openFile(const Twine &Path) { - ErrorOr> MB = MemoryBuffer::getFile(Path); + ErrorOr> MB = + MemoryBuffer::getFile(Path, /*IsText=*/true); if (std::error_code EC = MB.getError()) { llvm::errs() << "cannot open file " << Path << ": " << EC.message() << "\n"; -- cgit v1.1