[PATCH] D144207: [llvm-cov] Create syntax to pass source w/o binary.
Daniel Thornburgh via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 16 11:17:49 PST 2023
mysterymath updated this revision to Diff 498098.
mysterymath added a comment.
Correct .rst syntax.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144207/new/
https://reviews.llvm.org/D144207
Files:
compiler-rt/test/profile/Linux/binary-id-lookup.c
llvm/docs/CommandGuide/llvm-cov.rst
llvm/tools/llvm-cov/CodeCoverage.cpp
Index: llvm/tools/llvm-cov/CodeCoverage.cpp
===================================================================
--- llvm/tools/llvm-cov/CodeCoverage.cpp
+++ llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -636,7 +636,7 @@
"dump-collected-objects", cl::Optional, cl::Hidden,
cl::desc("Show the collected coverage object files"));
- cl::list<std::string> InputSourceFiles(cl::Positional,
+ cl::list<std::string> InputSourceFiles("sources", cl::Positional,
cl::desc("<Source files>"));
cl::opt<bool> DebugDumpCollectedPaths(
Index: llvm/docs/CommandGuide/llvm-cov.rst
===================================================================
--- llvm/docs/CommandGuide/llvm-cov.rst
+++ llvm/docs/CommandGuide/llvm-cov.rst
@@ -188,14 +188,14 @@
SYNOPSIS
^^^^^^^^
-:program:`llvm-cov show` [*options*] -instr-profile *PROFILE* *BIN* [*-object BIN,...*] [[*-object BIN*]] [*SOURCES*]
+:program:`llvm-cov show` [*options*] -instr-profile *PROFILE* [*BIN*] [*-object BIN*]... [*-sources*] [*SOURCE*]...
DESCRIPTION
^^^^^^^^^^^
The :program:`llvm-cov show` command shows line by line coverage of the
-binaries *BIN*,... using the profile data *PROFILE*. It can optionally be
-filtered to only show the coverage for the files listed in *SOURCES*.
+binaries *BIN*... using the profile data *PROFILE*. It can optionally be
+filtered to only show the coverage for the files listed in *SOURCE*....
*BIN* may be an executable, object file, dynamic library, or archive (thin or
otherwise).
@@ -370,14 +370,14 @@
SYNOPSIS
^^^^^^^^
-:program:`llvm-cov report` [*options*] -instr-profile *PROFILE* *BIN* [*-object BIN,...*] [[*-object BIN*]] [*SOURCES*]
+:program:`llvm-cov report` [*options*] -instr-profile *PROFILE* [*BIN*] [*-object BIN*]... [*-sources*] [*SOURCE*]...
DESCRIPTION
^^^^^^^^^^^
The :program:`llvm-cov report` command displays a summary of the coverage of
-the binaries *BIN*,... using the profile data *PROFILE*. It can optionally be
-filtered to only show the coverage for the files listed in *SOURCES*.
+the binaries *BIN*... using the profile data *PROFILE*. It can optionally be
+filtered to only show the coverage for the files listed in *SOURCE*....
*BIN* may be an executable, object file, dynamic library, or archive (thin or
otherwise).
@@ -451,13 +451,13 @@
SYNOPSIS
^^^^^^^^
-:program:`llvm-cov export` [*options*] -instr-profile *PROFILE* *BIN* [*-object BIN,...*] [[*-object BIN*]] [*SOURCES*]
+:program:`llvm-cov export` [*options*] -instr-profile *PROFILE* [*BIN*] [*-object BIN*]... [*-sources*] [*SOURCE*]...
DESCRIPTION
^^^^^^^^^^^
The :program:`llvm-cov export` command exports coverage data of the binaries
-*BIN*,... using the profile data *PROFILE* in either JSON or lcov trace file
+*BIN*... using the profile data *PROFILE* in either JSON or lcov trace file
format.
When exporting JSON, the regions, functions, branches, expansions, and
@@ -465,7 +465,7 @@
file, the line-based coverage, branch coverage, and summaries will be exported.
The exported data can optionally be filtered to only export the coverage
-for the files listed in *SOURCES*.
+for the files listed in *SOURCE*....
For information on compiling programs for coverage and generating profile data,
see :ref:`llvm-cov-show`.
Index: compiler-rt/test/profile/Linux/binary-id-lookup.c
===================================================================
--- compiler-rt/test/profile/Linux/binary-id-lookup.c
+++ compiler-rt/test/profile/Linux/binary-id-lookup.c
@@ -9,6 +9,7 @@
// RUN: cp %t.main %t/.build-id/ab/cd1234.debug
// RUN: llvm-profdata merge -o %t.profdata %t.profdir/default_*.profraw
// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t | FileCheck %s
+// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t -sources %t/foo.c | FileCheck %s --check-prefix=FOO-ONLY
// RUN: echo "bad" > %t/.build-id/ab/cd1234.debug
// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t %t.main | FileCheck %s
// RUN: not llvm-cov show -instr-profile %t.profdata -debug-file-directory %t/empty 2>&1 | FileCheck %s --check-prefix=NODATA
@@ -17,6 +18,7 @@
// CHECK: 2| 1|void bar(void) {}
// CHECK: 3| 1|int main() {
+// FOO-ONLY: 1| 1|void foo(void) {}
// NODATA: error: Failed to load coverage: '': No coverage data found
//--- foo.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144207.498098.patch
Type: text/x-patch
Size: 4395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230216/db74a942/attachment-0001.bin>
More information about the llvm-commits
mailing list