[all-commits] [llvm/llvm-project] e4172c: Introduce the type `CounterPair` for RegionCounterMap

NAKAMURA Takumi via All-commits all-commits at lists.llvm.org
Thu Oct 17 08:07:40 PDT 2024


  Branch: refs/heads/users/chapuni/cov/single/pair
  Home:   https://github.com/llvm/llvm-project
  Commit: e4172ca273a6fdfcbfc4662c9e37276ef34c2df4
      https://github.com/llvm/llvm-project/commit/e4172ca273a6fdfcbfc4662c9e37276ef34c2df4
  Author: NAKAMURA Takumi <geek4civic at gmail.com>
  Date:   2024-10-17 (Thu, 17 Oct 2024)

  Changed paths:
    M clang/lib/CodeGen/CGDecl.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/CodeGen/CGExprScalar.cpp
    M clang/lib/CodeGen/CGStmt.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/CodeGen/CodeGenPGO.cpp
    M clang/lib/CodeGen/CodeGenPGO.h
    M clang/lib/CodeGen/CoverageMappingGen.cpp
    M clang/lib/CodeGen/CoverageMappingGen.h

  Log Message:
  -----------
  Introduce the type `CounterPair` for RegionCounterMap

`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::first` is used.

Each counter number can have `None` to suppress emitting counter
increment. `second` is initialized as `None` by default, since most
`Stmt*` don't have a pair of counters.

This change also provides stubs for the verifyer. 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 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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list