[clang] [llvm] [clang][coverage] Add opt-in call continuation counters for coverage (PR #201079)

Ankur raj via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 20:51:09 PDT 2026


ankurrj7 wrote:

Rebased this and added another pass over the edge cases I hit while testing this more.

The main fixes are:

- calls in unevaluated expressions, like `sizeof(f())`, should not reserve continuation counters;
- `for (...; cond; inc())` needs the condition count to come from the path after `inc()` returns, otherwise the next condition check can be counted too early;
- C++ constructor calls need the same continuation handling as normal calls, including written constructor initializers feeding the body count;
- the coverage mapping writer minimizer was using expression ids as marker state. That is risky because ids like 0 and 1 are real emitted ids, so I split the marker state from the remapped id.

I also kept the tests split along the lines discussed earlier: CoverageMapping checks the regions/counters, Profile keeps the IR/single-byte checks.

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


More information about the llvm-commits mailing list