diff options
author | Vedant Kumar <vsk@apple.com> | 2016-09-19 01:42:38 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-09-19 01:42:38 +0000 |
commit | 9ed5802680fda58d7aee3475d785923d3a0deab6 (patch) | |
tree | ce49090be965855606df02b124f8414273a66884 /clang/docs/SourceBasedCodeCoverage.rst | |
parent | 0dfc6f0809c27127bd61137c99cc8aa0b5e8e35a (diff) | |
download | bcm5719-llvm-9ed5802680fda58d7aee3475d785923d3a0deab6.tar.gz bcm5719-llvm-9ed5802680fda58d7aee3475d785923d3a0deab6.zip |
[docs] Touch up the code coverage doc
llvm-svn: 281881
Diffstat (limited to 'clang/docs/SourceBasedCodeCoverage.rst')
-rw-r--r-- | clang/docs/SourceBasedCodeCoverage.rst | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/clang/docs/SourceBasedCodeCoverage.rst b/clang/docs/SourceBasedCodeCoverage.rst index 8c4ab8d0ae4..f2f3f82e435 100644 --- a/clang/docs/SourceBasedCodeCoverage.rst +++ b/clang/docs/SourceBasedCodeCoverage.rst @@ -125,24 +125,24 @@ region counts (even in macro expansions): .. code-block:: none - 20| 1|#define BAR(x) ((x) || (x)) + 1| 20|#define BAR(x) ((x) || (x)) ^20 ^2 2| 2|template <typename T> void foo(T x) { - 22| 3| for (unsigned I = 0; I < 10; ++I) { BAR(I); } + 3| 22| for (unsigned I = 0; I < 10; ++I) { BAR(I); } ^22 ^20 ^20^20 - 2| 4|} + 4| 2|} ------------------ | void foo<int>(int): - | 1| 2|template <typename T> void foo(T x) { - | 11| 3| for (unsigned I = 0; I < 10; ++I) { BAR(I); } + | 2| 1|template <typename T> void foo(T x) { + | 3| 11| for (unsigned I = 0; I < 10; ++I) { BAR(I); } | ^11 ^10 ^10^10 - | 1| 4|} + | 4| 1|} ------------------ | void foo<float>(int): - | 1| 2|template <typename T> void foo(T x) { - | 11| 3| for (unsigned I = 0; I < 10; ++I) { BAR(I); } + | 2| 1|template <typename T> void foo(T x) { + | 3| 11| for (unsigned I = 0; I < 10; ++I) { BAR(I); } | ^11 ^10 ^10^10 - | 1| 4|} + | 4| 1|} ------------------ It's possible to generate a file-level summary of coverage statistics (instead @@ -177,6 +177,26 @@ A few final notes: % llvm-profdata merge -sparse foo1.profraw foo2.profdata -o foo3.profdata +Interpreting reports +==================== + +There are four statistics tracked in a coverage summary: + +* Function coverage is the percentage of functions which have been executed at + least once. A function is treated as having been executed if any of its + instantiations are executed. + +* Instantiation coverage is the percentage of function instantiations which + have been executed at least once. + +* Line coverage is the percentage of code lines which have been executed at + least once. + +* Region coverage is the percentage of code regions which have been executed at + least once. A code region may span multiple lines (e.g a large function with + no control flow). However, it's also possible for a single line to contain + multiple code regions (e.g some short-circuited logic). + Format compatibility guarantees =============================== |