[clang] Mark the file opened by DeserializedDeclsSourceRangePrinter as a text file (PR #135842)
Zibi Sarbinowski via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 12:14:15 PDT 2025
https://github.com/zibi2 created https://github.com/llvm/llvm-project/pull/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.
>From b162b0476058c40b2fcbf7ef397696caead11a7f Mon Sep 17 00:00:00 2001
From: Zibi Sarbinowski <zibi at ca.ibm.com>
Date: Tue, 15 Apr 2025 19:10:02 +0000
Subject: [PATCH] Mark the file opened by DeserializedDeclsSourceRangePrinter
as a text file
---
clang/lib/Frontend/FrontendAction.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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