llvm-project/llvm/lib/ProfileData
Igor Kudrin 1c99f650a7 [llvm-cov gcov] Fix calculating coverage of template functions
Template functions share the same lines in source files, so the common
container of lines' properties cannot be used to calculate the coverage
statistics of individual functions.

> cat tmpl.cpp
template <int N> int test() { return N; }
int main() { return test<1>() + test<2>(); }
> clang++ --coverage tmpl.cpp -o tmpl
> ./tmpl
> llvm-cov gcov tmpl.cpp -f
...
Function '_Z4testILi1EEiv'
Lines executed:100.00% of 1

Function '_Z4testILi2EEiv'
Lines executed:-nan% of 0
...
> llvm-cov-patched gcov tmpl.cpp -f
...
Function '_Z4testILi1EEiv'
Lines executed:100.00% of 1

Function '_Z4testILi2EEiv'
Lines executed:100.00% of 1
...

Differential Revision: https://reviews.llvm.org/D121390
2022-03-15 20:46:22 +04:00
..
Coverage [Support] Change zlib::compress to return void 2022-03-14 11:38:04 -07:00
CMakeLists.txt Reland "[memprof] Extend the index prof format to include memory profiles." 2022-02-17 22:09:52 -08:00
GCOV.cpp [llvm-cov gcov] Fix calculating coverage of template functions 2022-03-15 20:46:22 +04:00
InstrProf.cpp [Support] Change zlib::compress to return void 2022-03-14 11:38:04 -07:00
InstrProfCorrelator.cpp Cleanup includes: ProfileData 2022-02-24 13:25:11 +01:00
InstrProfReader.cpp Cleanup includes: ProfileData 2022-02-24 13:25:11 +01:00
InstrProfWriter.cpp Cleanup includes: ProfileData 2022-02-24 13:25:11 +01:00
MemProf.cpp Cleanup includes: ProfileData 2022-02-24 13:25:11 +01:00
ProfileSummaryBuilder.cpp Cleanup includes: ProfileData 2022-02-24 13:25:11 +01:00
RawMemProfReader.cpp [memprof] Filter out callstack frames which cannot be symbolized. 2022-03-04 11:10:08 -08:00
SampleProf.cpp [Support] Change zlib::compress to return void 2022-03-14 11:38:04 -07:00
SampleProfReader.cpp Cleanup includes: ProfileData 2022-02-24 13:25:11 +01:00
SampleProfWriter.cpp [Support] Change zlib::compress to return void 2022-03-14 11:38:04 -07:00