[clang] Fix coverage when `/fo` is used (PR #88201)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/88201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Fix coverage when /fo is used (PR #88201)
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (pdagobert) Changes Fixes https://github.com/llvm/llvm-project/issues/87304 --- Full diff: https://github.com/llvm/llvm-project/pull/88201.diff 1 Files Affected: - (modified) clang/lib/Driver/ToolChains/Clang.cpp (+4) ``diff diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 766a9b91e3c0ad..44d18acd25a589 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -802,6 +802,10 @@ static void addPGOAndCoverageFlags(const ToolChain , Compilation , } else if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT__SLASH_Fo)) { CoverageFilename = FinalOutput->getValue(); + StringRef V = FinalOutput->getValue(); + if (llvm::sys::path::is_separator(V.back())) { +CoverageFilename += llvm::sys::path::filename(Output.getBaseInput()); + } } else if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o)) { CoverageFilename = FinalOutput->getValue(); } else { `` https://github.com/llvm/llvm-project/pull/88201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Fix coverage when /fo is used (PR #88201)
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using `@` followed by their GitHub username. If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the [LLVM GitHub User Guide](https://llvm.org/docs/GitHub.html). You can also ask questions in a comment on this PR, on the [LLVM Discord](https://discord.com/invite/xS7Z362) or on the [forums](https://discourse.llvm.org/). https://github.com/llvm/llvm-project/pull/88201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Fix coverage when /fo is used (PR #88201)
https://github.com/pdagobert created https://github.com/llvm/llvm-project/pull/88201 Fixes https://github.com/llvm/llvm-project/issues/87304 >From 6db0e01e198de9e5ee4055f9433150818c429c10 Mon Sep 17 00:00:00 2001 From: pdagobert Date: Tue, 9 Apr 2024 23:10:58 +0200 Subject: [PATCH] Fix coverage when /fo is used --- clang/lib/Driver/ToolChains/Clang.cpp | 4 1 file changed, 4 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 766a9b91e3c0ad..44d18acd25a589 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -802,6 +802,10 @@ static void addPGOAndCoverageFlags(const ToolChain , Compilation , } else if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT__SLASH_Fo)) { CoverageFilename = FinalOutput->getValue(); + StringRef V = FinalOutput->getValue(); + if (llvm::sys::path::is_separator(V.back())) { +CoverageFilename += llvm::sys::path::filename(Output.getBaseInput()); + } } else if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o)) { CoverageFilename = FinalOutput->getValue(); } else { ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits