[PATCH] D71012: Also check /Fo when deciding on the .gcna / .gcda filename (PR44208)
Hans Wennborg via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 5 05:07:36 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rG18b72d337ef3: Also check /Fo when deciding on the .gcna / .gcda filename (PR44208) (authored by hans).
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71012/new/
https://reviews.llvm.org/D71012
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/clang_f_opts.c
Index: clang/test/Driver/clang_f_opts.c
===================================================================
--- clang/test/Driver/clang_f_opts.c
+++ clang/test/Driver/clang_f_opts.c
@@ -85,6 +85,9 @@
// CHECK-PROFILE-DIR-UNUSED-NOT: "-coverage-data-file" "abc
// CHECK-PROFILE-DIR-NEITHER-NOT: argument unused
+// RUN: %clang_cl -### /c --coverage /Fo/foo/bar.obj -- %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
+// CHECK-GCNO-LOCATION: "-coverage-notes-file" "{{.*}}/foo/bar.gcno"
+
// RUN: %clang -### -fprofile-arcs -ftest-coverage %s 2>&1 | FileCheck -check-prefix=CHECK-u %s
// RUN: %clang -### --coverage %s 2>&1 | FileCheck -check-prefix=CHECK-u %s
// CHECK-u-NOT: "-u{{.*}}"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -914,7 +914,9 @@
if ((Args.hasArg(options::OPT_c) || Args.hasArg(options::OPT_S)) &&
(EmitCovNotes || EmitCovData) && Output.isFilename()) {
SmallString<128> OutputFilename;
- if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o))
+ if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT__SLASH_Fo))
+ OutputFilename = FinalOutput->getValue();
+ else if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o))
OutputFilename = FinalOutput->getValue();
else
OutputFilename = llvm::sys::path::filename(Output.getBaseInput());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71012.232317.patch
Type: text/x-patch
Size: 1490 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191205/5bd9e40b/attachment.bin>
More information about the cfe-commits
mailing list