1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

More fix to coverage documentation

llvm-svn: 256895
This commit is contained in:
Xinliang David Li 2016-01-06 01:23:41 +00:00
parent 0526fb6aaa
commit 88f1bad0de

View File

@ -241,7 +241,13 @@ For example, lets 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 version number can have the following values:
The coverage mapping header has the following fields:
* 0 — The first (current) version of the coverage mapping format.
* 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 length of the string in the third field of *__llvm_coverage_mapping* that contains the encoded coverage mapping data.
* 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. |
+----------+-------------------------------------------------------------------------------------------------------------------------+