diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:11:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-09 17:11:07 +0900 |
commit | 397ac44f623f891d8f05d6673a95984ac0a26671 (patch) | |
tree | 6a77b463f700e090df586672c26b9fe765fd115b /llvm/lib/Transforms/Utils/Local.cpp | |
parent | d30a5fc5a2f88dee1198bd2285ddf1c55da51bb6 (diff) | |
download | llvm-397ac44f623f891d8f05d6673a95984ac0a26671.zip llvm-397ac44f623f891d8f05d6673a95984ac0a26671.tar.gz llvm-397ac44f623f891d8f05d6673a95984ac0a26671.tar.bz2 |
[Coverage] Introduce the type `CounterPair` for RegionCounterMap. NFC. (#112724)
`CounterPair` can hold `<uint32_t, uint32_t>` instead of current
`unsigned`, to hold also the counter number of SkipPath. For now, this
change provides the skeleton and only `CounterPair::Executed` is used.
Each counter number can have `None` to suppress emitting counter
increment. 2nd element `Skipped` is initialized as `None` by default,
since most `Stmt*` don't have a pair of counters.
This change also provides stubs for the verifier. I'll provide the impl
of verifier for `+Asserts` later.
`markStmtAsUsed(bool, Stmt*)` may be used to inform that other side
counter may not emitted.
`markStmtMaybeUsed(S)` may be used for the `Stmt` and its inner will be
excluded for emission in the case of skipping by constant folding. I put
it into places where I found.
`verifyCounterMap()` will check the coverage map and the counter map,
and can be used to report inconsistency.
These verifier methods shall be eliminated in `-Asserts`.
https://discourse.llvm.org/t/rfc-integrating-singlebytecoverage-with-branch-coverage/82492
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
0 files changed, 0 insertions, 0 deletions