[PATCH] Fixed llvm-cov to count edges instead of blocks

Yuchen Wu yuchenericwu at hotmail.com
Wed Oct 23 13:01:23 PDT 2013


This was a fundamental flaw in llvm-cov where it treated the values in
the GCDA files as block counts instead of edge counts. This created
incorrect line counts when branching was present. Instead, the edge
counts should be summed to obtain the correct block count.

The fix was tested using custom test files as well as single source
files from the test-suite directory. The behaviour can be verified by
reading the GCOV documentation that describes the GCDA spec ("ARC_COUNTS
gives the counter values for those arcs that are instrumented") and the
header description provided by GCOVProfiling.cpp ("instruments the code
that runs to records (sic) the edges between blocks that run and emit a
complementary "gcda" file on exit"). 		 	   		  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Fixed-llvm-cov-to-count-edges-instead-of-blocks.patch
Type: application/octet-stream
Size: 2921 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131023/551c2428/attachment.obj>


More information about the llvm-commits mailing list