[clang] [llvm] [sancov] add -fsanitize-coverage=trace-pc-entry-exit (PR #185972)

Jann Horn via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 13 05:16:16 PDT 2026


================
@@ -201,6 +201,12 @@ With ``-fsanitize-coverage=trace-pc`` the compiler will insert
 ``__sanitizer_cov_trace_pc()`` on every edge.
 With an additional ``...=trace-pc,indirect-calls`` flag
 ``__sanitizer_cov_trace_pc_indirect(void *callee)`` will be inserted on every indirect call.
+With ``-fsanitize-coverage=trace-pc-entry-exit`` the compiler will insert
+``__sanitizer_cov_trace_pc_entry()`` on function entry (and will not emit
+``__sanitizer_cov_trace_pc()`` for this basic block), and insert
----------------
thejh wrote:

In that case, the entry basic block is instrumented with both `__sanitizer_cov_trace_pc_entry` and `__sanitizer_cov_trace_pc_guard`. I think that's the right behavior, since `__sanitizer_cov_trace_pc_entry` doesn't provide a guard variable.

I'll send a fixup to document this in a bit.

https://github.com/llvm/llvm-project/pull/185972


More information about the cfe-commits mailing list