[clang] bd0b903 - Mark the file opened by DeserializedDeclsSourceRangePrinter as a text file (#135842)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 17 07:09:00 PDT 2025
Author: Zibi Sarbinowski
Date: 2025-04-17T10:08:57-04:00
New Revision: bd0b903a91721570e0bc98f7ed8b0aaf2f2a628b
URL: https://github.com/llvm/llvm-project/commit/bd0b903a91721570e0bc98f7ed8b0aaf2f2a628b
DIFF: https://github.com/llvm/llvm-project/commit/bd0b903a91721570e0bc98f7ed8b0aaf2f2a628b.diff
LOG: Mark the file opened by DeserializedDeclsSourceRangePrinter as a text file (#135842)
This PR will fix the following lit failure seeing on z/OS and most likely on Windows:
`FAIL: Clang :: Frontend/dump-minimization-hints.cpp`
Without `OF_TextWithCRLF` flag, a file is treated as binary and is read improperly, at least on z/OS.
Added:
Modified:
clang/lib/Frontend/FrontendAction.cpp
Removed:
################################################################################
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index bd084aa94fc37..1c4dec08575d1 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -312,7 +312,7 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
std::error_code ErrorCode;
auto FileStream = std::make_unique<llvm::raw_fd_ostream>(
DumpDeserializedDeclarationRangesPath, ErrorCode,
- llvm::sys::fs::OF_None);
+ llvm::sys::fs::OF_TextWithCRLF);
if (!ErrorCode) {
Consumers.push_back(std::make_unique<DeserializedDeclsSourceRangePrinter>(
CI.getSourceManager(), std::move(FileStream)));
More information about the cfe-commits
mailing list