Lines Matching full:coverage
5 LLVM Code Coverage Mapping Format
14 LLVM's code coverage mapping format is used to provide code coverage
18 This document is aimed at those who use LLVM's code coverage mapping to provide
19 code coverage analysis for their own programs, and for those who would like
23 We start by showing how to use LLVM and Clang for code coverage analysis,
24 then we briefly desribe LLVM's code coverage mapping format and the
25 way that Clang and LLVM's code coverage tool work with this format. After
26 the basics are down, more advanced features of the coverage mapping format
33 Here's a short story that describes how to generate code coverage overview
48 * Finally, run LLVM's code coverage tool (*llvm-cov*) to produce the code
49 coverage overview for the sample source file:
56 LLVM's code coverage mapping format is designed to be a self contained
59 to store the data that is required for a code coverage tool to map between
63 The mapping data is used in two places in the code coverage process:
74 After that, the tool is able to generate various code coverage reports
77 The coverage mapping format aims to be a "universal format" that would be
79 provide the frontend the possibility of generating the minimal coverage mapping
89 coverage mapping format works.
91 The coverage mapping format operates on a per-function level as the
93 For each function that requires code coverage, the frontend has to create
94 coverage mapping data that can map between the source code ranges and
100 The function's coverage mapping data contains an array of mapping regions.
102 the `file id <coverage file id_>`_, the `coverage mapping counter`_ and
106 * Code regions associate portions of source code and `coverage mapping
108 by the code coverage tool to compute the execution counts for lines,
110 the various code coverage statistics for a function.
125 `coverage mapping counters`_, as the frontend knows that they are never
126 executed. They are used by the code coverage tool to mark the skipped lines
139 used by the code coverage tool to find the mapping regions that are created
141 expanded file id. They don't associate with `coverage mapping counters`_,
142 as the code coverage tool can determine the execution count for this region
185 A coverage mapping counter can represents a reference to the profile
191 coverage mapping counters or other expressions.
209 Finally, a coverage mapping counter can also represent an execution count of
210 of zero. The zero counter is used to provide coverage mapping for
219 The zero counters allow the code coverage tool to display proper line execution
227 The coverage mapping data is stored in the LLVM IR using a single global
244 The coverage mapping variable generated by Clang has 3 fields:
246 * Coverage mapping header.
250 * Coverage mapping data which is an array of bytes. Zero paddings are added at the end to force 8 b…
256 { i32, i32, i32, i32 } ; Coverage map header
260 i32 20, ; The length of the string that contains the encoded coverage mapping data
261 i32 1, ; Coverage mapping format version
266 i32 9, ; Function's encoded coverage mapping data string length
271 i32 9, ; Function's encoded coverage mapping data string length
283 i32 9, ; Function's encoded coverage mapping data string length
288 Coverage Mapping Header:
291 The coverage mapping header has the following fields:
297 …ng in the third field of *__llvm_coverage_mapping* that contains the encoded coverage mapping data.
319 the encoded filenames used by this translation unit and the encoded coverage
333 IR for the `coverage mapping sample`_ that was shown earlier:
336 coverage mapping data for the sample translation unit:
360 * The length of the substring that contains the encoded coverage mapping data
364 Therefore, the coverage mapping for the first function record is encoded
382 …| ``0x01`` | The coverage mapping counter for the first region in this function. The value of 1 te…
394 * The length of the substring that contains the encoded coverage mapping data
398 * The two trailing bytes are zeroes and are used to pad the coverage mapping
404 The per-function coverage mapping data is encoded as a stream of bytes,
415 `types <cvmtypes_>`_ as the per-function coverage mapping data, with the
454 File id mapping in a function's coverage mapping stream
462 A `coverage mapping counter`_ is stored in a single `LEB value <LEB128_>`_.