[llvm] [Coverage] getMaxBitmapSize: Scan `max(BitmapIdx)` instead of the last `Decision` (PR #78963)

Jessica Paquette via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 05:21:54 PST 2024


================
@@ -566,14 +567,14 @@ static unsigned getMaxBitmapSize(const CounterMappingContext &Ctx,
                                  const CoverageMappingRecord &Record) {
   unsigned MaxBitmapID = 0;
   unsigned NumConditions = 0;
-  // The last DecisionRegion has the highest bitmap byte index used in the
-  // function, which when combined with its number of conditions, yields the
-  // full bitmap size.
+  // Scan max(BitmapIdx).
+  // Note that `<=` is used insted of `<`, because `BitmapIdx == 0` is valid
+  // and `MaxbitmapID is `unsigned`. `BitmapIdx` is unique in the record.
----------------
ornata wrote:

Nit: s/MaxbitmapID/MaxBitmapID/

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


More information about the llvm-commits mailing list