[llvm] r256895 - More fix to coverage documentation

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 17:23:41 PST 2016


Author: davidxl
Date: Tue Jan  5 19:23:41 2016
New Revision: 256895

URL: http://llvm.org/viewvc/llvm-project?rev=256895&view=rev
Log:
More fix to coverage documentation

Modified:
    llvm/trunk/docs/CoverageMappingFormat.rst

Modified: llvm/trunk/docs/CoverageMappingFormat.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CoverageMappingFormat.rst?rev=256895&r1=256894&r2=256895&view=diff
==============================================================================
--- llvm/trunk/docs/CoverageMappingFormat.rst (original)
+++ llvm/trunk/docs/CoverageMappingFormat.rst Tue Jan  5 19:23:41 2016
@@ -241,7 +241,13 @@ For example, let’s consider a C fil
     return 13;
   }
 
-The coverage mapping variable generated by Clang is:
+The coverage mapping variable generated by Clang has 3 fields:
+
+* Coverage mapping header.
+
+* An array of function records.
+
+* Coverage mapping data which is an array of bytes. Zero paddings are added at the end to force 8 byte alignment.
 
 .. code-block:: llvm
 
@@ -266,12 +272,18 @@ The coverage mapping variable generated
    [40 x i8] c"..." ; Encoded data (dissected later)
   }, section "__llvm_covmap", align 8
 
-Version:
---------
+Coverage Mapping Header:
+------------------------
+
+The coverage mapping header has the following fields:
+
+* The number of function records.
+
+* The length of the string in the third field of *__llvm_coverage_mapping* that contains the encoded translation unit filenames.
 
-The coverage mapping version number can have the following values:
+* The length of the string in the third field of *__llvm_coverage_mapping* that contains the encoded coverage mapping data.
 
-* 0 — The first (current) version of the coverage mapping format.
+* The format version. 0 is the first (current) version of the coverage mapping format.
 
 .. _function records:
 
@@ -335,7 +347,7 @@ IR for the `coverage mapping sample`_ th
 * The length of the substring that contains the encoded coverage mapping data
   for the first function is the value of the third field in the first
   structure in an array of `function records`_ stored in the
-  fifth field of the *__llvm_coverage_mapping* structure, which is the 9.
+  third field of the *__llvm_coverage_mapping* structure, which is the 9.
   Therefore, the coverage mapping for the first function record is encoded
   in this string:
 
@@ -355,7 +367,7 @@ IR for the `coverage mapping sample`_ th
   | ``0x01`` | The number of mapping regions that are stored in an array for the function's file id #0.                                |
   +----------+-------------------------------------------------------------------------------------------------------------------------+
   | ``0x01`` | The coverage mapping counter for the first region in this function. The value of 1 tells us that it's a coverage        |
-  |          | mapping counter that is a reference ot the profile instrumentation counter with an index of 0.                          |
+  |          | mapping counter that is a reference to the profile instrumentation counter with an index of 0.                          |
   +----------+-------------------------------------------------------------------------------------------------------------------------+
   | ``0x01`` | The starting line of the first mapping region in this function.                                                         |
   +----------+-------------------------------------------------------------------------------------------------------------------------+




More information about the llvm-commits mailing list