[llvm] [llvm-cov] format cells in code coverage report with 0/0 branches/functions/lines differently (PR #75780)

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 00:34:19 PST 2023


================
@@ -309,7 +323,9 @@ void emitTableRow(raw_ostream &OS, const CoverageViewOptions &Opts,
           RSO << '(' << Hit << '/' << Total << ')';
         }
         const char *CellClass = "column-entry-yellow";
-        if (Pctg >= Opts.HighCovWatermark)
+        if (!Total) {
+          CellClass = "column-entry-gray";
+        } else if (Pctg >= Opts.HighCovWatermark)
----------------
chapuni wrote:

We don't use braces on a single-statement. Could you follow?

https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

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


More information about the llvm-commits mailing list