Open LebedevRI opened 7 years ago
I would say it's not just about multiple binaries. In general it would be nice if the generated .profraw files would contain a reference to the binary that generated them (with the option of having references to multiple binaries).
Then you could call llvm-cov with "-object" if you would want to override the reference in the .profdata file (changed path/different machine/whatever), but by default the binary referenced by the .profdata files is what it would be used.
You can call gcov with the source file, plus --object-directory to tell it where the .gcno/.gcda files are. Or you can call gcov with the .gcda file, and the .gcda file already references the source file.
FWIW I always use absolute files, that's what I'm interested in in clang. But gcc has a "-fprofile-abs-path" flag to make the references inside .gcno files relative or absolute and clang could have the same.
Adding people from https://reviews.llvm.org/D25086 into CC, just in case
Extended Description
I was just experimenting with getting code coverage output from clang. When there is just one binary, then llvm-cov show works fine.
But if the coverage data was merged from multiple binaries, to get the complete info about the full coverage, each of these binaries needs to be explicitly passed into llvm-cov show.
This is rather unusable. It would be nice if there could be some native solution, much like what gcov/lcov already does, that would not require specifying every binary...
For me, i should be able to solve it with some cmake magic though.