[PATCH] D138847: MC/DC in LLVM Source-Based Code Coverage: llvm-cov visualization

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 5 10:40:46 PST 2023


MaskRay added inline comments.


================
Comment at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:37
 #include <memory>
+#include <sstream>
 #include <string>
----------------
This is an uncommon include in LLVM. We usually use format, formatv, etc.


================
Comment at: llvm/tools/llvm-cov/CoverageSummaryInfo.cpp:47
 
+static void sumMCDCPairs(size_t &NumPairs, size_t &CoveredPairs,
+                         const ArrayRef<MCDCRecord> &Records) {
----------------
prefer std::pair return value
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-out



================
Comment at: llvm/tools/llvm-cov/CoverageSummaryInfo.cpp:50
+  for (const auto &Record : Records)
+    for (unsigned c = 0; c < Record.getNumConditions(); c++) {
+      if (!Record.isCondFolded(c))
----------------
phosek wrote:
> 
https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138847/new/

https://reviews.llvm.org/D138847



More information about the llvm-commits mailing list