[llvm-branch-commits] [clang] [llvm] [Coverage] Make additional counters available for BranchRegion. NFC. (PR #112730)

Jessica Paquette via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 18 20:09:15 PST 2024


================
@@ -638,6 +638,10 @@ static unsigned getMaxCounterID(const CounterMappingContext &Ctx,
   unsigned MaxCounterID = 0;
   for (const auto &Region : Record.MappingRegions) {
     MaxCounterID = std::max(MaxCounterID, Ctx.getMaxCounterID(Region.Count));
+    if (Region.Kind == CounterMappingRegion::BranchRegion ||
----------------
ornata wrote:

I feel like it would be nice to add helpers for Region.Kind just to make the code a little easier to read.

E.g.

```
isBranchRegion(Region) { return Region.Kind == CounterMappingRegion::BranchRegion; } 
isMCDCBranchRegion(Region)
```
Maybe in a follow-up commit?

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


More information about the llvm-branch-commits mailing list