diff options
Diffstat (limited to 'docs/CoverageMappingFormat.rst')
-rw-r--r-- | docs/CoverageMappingFormat.rst | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/docs/CoverageMappingFormat.rst b/docs/CoverageMappingFormat.rst index 84cddff5ed9ed..158255ab86397 100644 --- a/docs/CoverageMappingFormat.rst +++ b/docs/CoverageMappingFormat.rst @@ -251,27 +251,40 @@ The coverage mapping variable generated by Clang has 3 fields: .. code-block:: llvm - @__llvm_coverage_mapping = internal constant { { i32, i32, i32, i32 }, [2 x { i8*, i32, i32 }], [40 x i8] } + @__llvm_coverage_mapping = internal constant { { i32, i32, i32, i32 }, [2 x { i64, i32, i64 }], [40 x i8] } { { i32, i32, i32, i32 } ; Coverage map header { i32 2, ; The number of function records i32 20, ; The length of the string that contains the encoded translation unit filenames i32 20, ; The length of the string that contains the encoded coverage mapping data - i32 0, ; Coverage mapping format version + i32 1, ; Coverage mapping format version }, - [2 x { i8*, i32, i32 }] [ ; Function records - { i8*, i32, i32 } { i8* getelementptr inbounds ([3 x i8]* @__llvm_profile_name_foo, i32 0, i32 0), ; Function's name - i32 3, ; Function's name length - i32 9 ; Function's encoded coverage mapping data string length + [2 x { i64, i32, i64 }] [ ; Function records + { i64, i32, i64 } { + i64 0x5cf8c24cdb18bdac, ; Function's name MD5 + i32 9, ; Function's encoded coverage mapping data string length + i64 0 ; Function's structural hash }, - { i8*, i32, i32 } { i8* getelementptr inbounds ([3 x i8]* @__llvm_profile_name_bar, i32 0, i32 0), ; Function's name - i32 3, ; Function's name length - i32 9 ; Function's encoded coverage mapping data string length + { i64, i32, i64 } { + i64 0xe413754a191db537, ; Function's name MD5 + i32 9, ; Function's encoded coverage mapping data string length + i64 0 ; Function's structural hash }], [40 x i8] c"..." ; Encoded data (dissected later) }, section "__llvm_covmap", align 8 +The function record layout has evolved since version 1. In version 1, the function record for *foo* is defined as follows: + +.. code-block:: llvm + + { i8*, i32, i32, i64 } { i8* getelementptr inbounds ([3 x i8]* @__profn_foo, i32 0, i32 0), ; Function's name + i32 3, ; Function's name length + i32 9, ; Function's encoded coverage mapping data string length + i64 0 ; Function's structural hash + } + + Coverage Mapping Header: ------------------------ @@ -283,7 +296,7 @@ The coverage mapping header has the following fields: * 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. +* The format version. The current version is 2 (encoded as a 1). .. _function records: @@ -294,10 +307,10 @@ A function record is a structure of the following type: .. code-block:: llvm - { i8*, i32, i32 } + { i64, i32, i64 } -It contains the pointer to the function's name, function's name length, -and the length of the encoded mapping data for that function. +It contains function name's MD5, the length of the encoded mapping data for that function, and function's +structural hash value. Encoded data: ------------- @@ -417,7 +430,7 @@ and can appear after ``:`` in the ``[foo : type]`` description. LEB128 ^^^^^^ -LEB128 is an unsigned interger value that is encoded using DWARF's LEB128 +LEB128 is an unsigned integer value that is encoded using DWARF's LEB128 encoding, optimizing for the case where values are small (1 byte for values less than 128). |