[clang] [z/OS][SystemZ] Clang dependency files are text files (PR #121849)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 6 14:14:01 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Kai Nacke (redstar)
<details>
<summary>Changes</summary>
The dependency file and the P1689 file are text files, but the
open call misses the OF_Text flag. This PR adds the flag.
Fixes regressions in test cases ClangScanDeps/modules-extern-unrelated.m
and ClangScanDeps/P1689.cppm.
---
Full diff: https://github.com/llvm/llvm-project/pull/121849.diff
1 Files Affected:
- (modified) clang/tools/clang-scan-deps/ClangScanDeps.cpp (+4-4)
``````````diff
diff --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
index bd36181fca3f31..709dc513be2811 100644
--- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp
+++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -913,7 +913,7 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) {
return llvm::nulls();
std::error_code EC;
- FileOS.emplace(OutputFileName, EC);
+ FileOS.emplace(OutputFileName, EC, llvm::sys::fs::OF_Text);
if (EC) {
llvm::errs() << "Failed to open output file '" << OutputFileName
<< "': " << llvm::errorCodeToError(EC) << '\n';
@@ -1003,9 +1003,9 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) {
auto OSIter = OSs.find(MakeformatOutputPath);
if (OSIter == OSs.end()) {
std::error_code EC;
- OSIter =
- OSs.try_emplace(MakeformatOutputPath, MakeformatOutputPath, EC)
- .first;
+ OSIter = OSs.try_emplace(MakeformatOutputPath, MakeformatOutputPath,
+ EC, llvm::sys::fs::OF_Text)
+ .first;
if (EC)
llvm::errs() << "Failed to open P1689 make format output file \""
<< MakeformatOutputPath << "\" for " << EC.message()
``````````
</details>
https://github.com/llvm/llvm-project/pull/121849
More information about the cfe-commits
mailing list