More fix to coverage documentation
authorXinliang David Li <davidxl@google.com>
Wed, 6 Jan 2016 01:23:41 +0000 (01:23 +0000)
committerXinliang David Li <davidxl@google.com>
Wed, 6 Jan 2016 01:23:41 +0000 (01:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256895 91177308-0d34-0410-b5e6-96231b3b80d8

docs/CoverageMappingFormat.rst

index ea40a1ddb8cd0fbff6a1765f3057c4de88768b72..84cddff5ed9ed9b12b455d235bba4f57104bab53 100644 (file)
@@ -241,7 +241,13 @@ For example, let’s consider a C file and how it gets compiled to LLVM:
     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 by Clang is:
    [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`_ that was shown earlier:
 * 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`_ that was shown earlier:
   | ``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.                                                         |
   +----------+-------------------------------------------------------------------------------------------------------------------------+