[PATCH] D36391: [llvm-cov] Add an option which maps the location of source directories on another machine to your local copies

Sean Eveson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 02:49:06 PDT 2017

seaneveson created this revision.

This patch adds the -path-equivalence option (example: llvm-cov show -path-equivalence=/origin/path,/local/path) which maps the source code path from one machine to another when using `llvm-cov show`. This is similar to the -filename-equivalence option, but doesn't require you to specify all the source files on the command line.

This allows you to generate the coverage data on one machine (e.g. in a CI system), and then use llvm-cov on another machine where you have the same code base on a different path.



Index: test/tools/llvm-cov/path_equivalence.c
--- /dev/null
+++ test/tools/llvm-cov/path_equivalence.c
@@ -0,0 +1,7 @@
+// RUN: llvm-profdata merge %S/Inputs/path_equivalence.proftext -o %t.profdata
+// RUN: llvm-cov show %S/Inputs/path_equivalence.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S | FileCheck %s
+int main() {} // CHECK: [[@LINE]]|      1|int main() {}
+// RUN: llvm-cov show %S/Inputs/path_equivalence.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S --filename-equivalence %s | FileCheck --check-prefix IGNORED_REMAP %s
+// IGNORED_REMAP: warning: path-equivalence was ignored as source files were given
Index: test/tools/llvm-cov/Inputs/path_equivalence.proftext
--- /dev/null
+++ test/tools/llvm-cov/Inputs/path_equivalence.proftext
@@ -0,0 +1,8 @@
+# Func Hash:
+# Num Counters:
+# Counter Values:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36391.109962.patch
Type: text/x-patch
Size: 1007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170807/91226c42/attachment.bin>

More information about the llvm-commits mailing list