Skip to content

Mark the file opened by DeserializedDeclsSourceRangePrinter as a text file #135842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

zibi2
Copy link
Contributor

@zibi2 zibi2 commented Apr 15, 2025

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.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 15, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 15, 2025

@llvm/pr-subscribers-clang

Author: Zibi Sarbinowski (zibi2)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/135842.diff

1 Files Affected:

  • (modified) clang/lib/Frontend/FrontendAction.cpp (+1-1)
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)));

Copy link
Contributor

@abhina-sree abhina-sree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zibi2 zibi2 force-pushed the zs_decl_line_range_file branch from 81a1df4 to b162b04 Compare April 17, 2025 01:43
@zibi2
Copy link
Contributor Author

zibi2 commented Apr 17, 2025

The 2 failing checks above don't seem to be related and they happen in other PRs. I'm going to merge this in.

@zibi2 zibi2 merged commit bd0b903 into llvm:main Apr 17, 2025
17 of 19 checks passed
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
… file (llvm#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.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
… file (llvm#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants