Skip to content

Commit 13bd6fb

Browse files
committed
[docs/Coverage] Answer FAQ about optimization
1 parent 496ca41 commit 13bd6fb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

clang/docs/SourceBasedCodeCoverage.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,19 @@ Format compatibility guarantees
305305
minor version increment is for added functionality, and patch version
306306
increments are for bugfixes.
307307

308+
Impact of llvm optimizations on coverage reports
309+
================================================
310+
311+
llvm optimizations (such as inlining or CFG simplification) should have no
312+
impact on coverage report quality. This is due to the fact that the mapping
313+
from source regions to profile counters is immutable, and is generated before
314+
the llvm optimizer kicks in. The optimizer can't prove that profile counter
315+
instrumentation is safe to delete (because it's not: it affects the profile the
316+
program emits), and so leaves it alone.
317+
318+
Note that this coverage feature does not rely on information that can degrade
319+
during the course of optimization, such as debug info line tables.
320+
308321
Using the profiling runtime without static initializers
309322
=======================================================
310323

0 commit comments

Comments
 (0)