Lines Matching refs:mapping

14 LLVM's code coverage mapping format is used to provide code coverage
19 mapping works under the hood. A prior knowledge of how Clang's profile guided
24 We start by briefly describing LLVM's code coverage mapping format and the
26 the basics are down, more advanced features of the coverage mapping format
33 LLVM's code coverage mapping format is designed to be a self contained
35 It's described in this document as a **mapping** format because its goal is
40 The mapping data is used in two places in the code coverage process:
42 1. When clang compiles a source file with ``-fcoverage-mapping``, it
43 generates the mapping information that describes the mapping between the
48 2. It is also used by *llvm-cov* - the mapping information is extracted from an
54 The coverage mapping format aims to be a "universal format" that would be
56 provide the frontend the possibility of generating the minimal coverage mapping
58 instead of emitting mapping information for each statement in a function, the
60 regions of code, and emit the mapping information only for those regions.
66 coverage mapping format works.
68 The coverage mapping format operates on a per-function level as the
71 coverage mapping data that can map between the source code ranges and
77 The function's coverage mapping data contains an array of mapping regions.
78 A mapping region stores the `source code range`_ that is covered by this region,
79 the `file id <coverage file id_>`_, the `coverage mapping counter`_ and
81 There are several kinds of mapping regions:
83 * Code regions associate portions of source code and `coverage mapping
84 counters`_. They make up the majority of the mapping regions. They are used
102 `coverage mapping counters`_, as the frontend knows that they are never
116 used by the code coverage tool to find the mapping regions that are created
118 expanded file id. They don't associate with `coverage mapping counters`_,
130 with a `coverage mapping counter`_ to track how many times an individual
131 condition evaluated to 'true' and another `coverage mapping counter`_ to
155 mapping region. Both locations include the line and the column numbers.
164 It enables Clang to produce mapping information for the code
175 .. _coverage mapping counter:
176 .. _coverage mapping counters:
181 A coverage mapping counter can represents a reference to the profile
187 coverage mapping counters or other expressions.
205 Finally, a coverage mapping counter can also represent an execution count of
206 of zero. The zero counter is used to provide coverage mapping for
221 code and refer to two coverage mapping counters, one to track the number of
228 The coverage mapping data is stored in the LLVM IR using a global constant
234 .. _coverage mapping sample:
245 The coverage mapping variable generated by Clang has 2 fields:
247 * Coverage mapping header.
263 …In prior versions, the length of the affixed string that contains the encoded coverage mapping data
264 i32 3, ; Coverage mapping format version
290 unit) reduces size bloat in the coverage mapping data. As part of this
291 change, region mapping information for a function is now included within the
305 i32 9, ; Function's encoded coverage mapping data string length
315 i32 9, ; Function's encoded coverage mapping data string length
321 The coverage mapping header has the following fields:
327 …rd field of *__llvm_coverage_mapping* that contains any encoded coverage mapping data affixed to t…
342 It contains the function name's MD5, the length of the encoded mapping data for
344 in the function's translation unit, and the encoded mapping data.
350 IR for the `coverage mapping sample`_ that was shown earlier:
353 coverage mapping data for the sample translation unit:
368 * The coverage mapping from the first function record is encoded in this string:
377 …of file ids used by this function. There is only one file id used by the mapping data in this func…
383 …| ``0x01`` | The number of mapping regions that are stored in an array for the function's file id …
385 …| ``0x01`` | The coverage mapping counter for the first region in this function. The value of 1 te…
386 …| | mapping counter that is a reference to the profile instrumentation counter with an in…
388 …| ``0x01`` | The starting line of the first mapping region in this function. …
390 …| ``0x0C`` | The starting column of the first mapping region in this function. …
392 …| ``0x02`` | The ending line of the first mapping region in this function. …
394 …| ``0x02`` | The ending column of the first mapping region in this function. …
397 * The length of the substring that contains the encoded coverage mapping data
398 for the second function record is also 9. It's structured like the mapping data
401 * The two trailing bytes are zeroes and are used to pad the coverage mapping
407 The per-function coverage mapping data is encoded as a stream of bytes,
415 ``[file id mapping, counter expressions, mapping regions]``
418 `types <cvmtypes_>`_ as the per-function coverage mapping data, with the
450 .. _file id mapping:
457 File id mapping in a function's coverage mapping stream
465 A `coverage mapping counter`_ is stored in a single `LEB value <LEB128_>`_.
518 The mapping regions are stored in an array of sub-arrays where every
530 The mapping regions for a specific file id are stored in an array that is
538 The mapping region record contains two sub-records ---
564 A mapping region whose header has a counter with a non-zero tag is
577 * bit 2: expansionRegionTag. If this bit is set, then this mapping region
586 * 0 - This mapping region is a code region with a counter of zero.
587 * 2 - This mapping region is a skipped region.
588 * 4 - This mapping region is a branch region.
600 current mapping region and the starting line of the previous mapping region.
602 If the current mapping region is the first region in the current
605 * *columnStart*: The starting column of the mapping region.
608 of the current mapping region.
610 * *columnEnd*: The ending column of the mapping region. If the high bit is set,
611 the current mapping region is a gap area. A count for a gap area is only used