[llvm-branch-commits] [llvm] c9afa3a - [Coverage][llvm-cov] Correctly export branch coverage in LCOV format

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 23 21:02:21 PDT 2021


Author: Christian Fetzer
Date: 2021-08-23T21:02:01-07:00
New Revision: c9afa3a749f0367c08960136cb13b44e57923f12

URL: https://github.com/llvm/llvm-project/commit/c9afa3a749f0367c08960136cb13b44e57923f12
DIFF: https://github.com/llvm/llvm-project/commit/c9afa3a749f0367c08960136cb13b44e57923f12.diff

LOG: [Coverage][llvm-cov] Correctly export branch coverage in LCOV format

Commit 9f2967bcfe2f7d1fc02281f0098306c90c2c10a5 introduced support for
branch coverage including export to the LCOV format.

This commit corrects the LCOV field name for branches from BFH to BRH.
The mistake seems to have slipped in as typo because the correct field
name BRH is used in the comment section at the beginning of the file.

Differential Revision: https://reviews.llvm.org/D108358

(cherry picked from commit 9116211d180ca417fa93d4e97e60f4ba849d58d9)

Added: 
    

Modified: 
    llvm/test/tools/llvm-cov/branch-export-lcov.test
    llvm/tools/llvm-cov/CoverageExporterLcov.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-cov/branch-export-lcov.test b/llvm/test/tools/llvm-cov/branch-export-lcov.test
index 3e4a300d645d7..1714123ec7be5 100644
--- a/llvm/test/tools/llvm-cov/branch-export-lcov.test
+++ b/llvm/test/tools/llvm-cov/branch-export-lcov.test
@@ -34,7 +34,7 @@
 // CHECK-DAG: BRDA:53,0,1,5
 // CHECK-NOT: BRDA
 // CHECK: BRF:30
-// CHECK: BFH:26
+// CHECK: BRH:26
 
 // Check recursive macro-expansions.
 // RUN: llvm-profdata merge %S/Inputs/branch-macros.proftext -o %t.profdata
@@ -70,4 +70,4 @@
 // MACROS-NOT: BRDA:37
 // MACROS-NOT: BRDA
 // MACROS: BRF:40
-// MACROS: BFH:24
+// MACROS: BRH:24

diff  --git a/llvm/tools/llvm-cov/CoverageExporterLcov.cpp b/llvm/tools/llvm-cov/CoverageExporterLcov.cpp
index 6cf5d9285b90a..0096a3d44d856 100644
--- a/llvm/tools/llvm-cov/CoverageExporterLcov.cpp
+++ b/llvm/tools/llvm-cov/CoverageExporterLcov.cpp
@@ -167,7 +167,7 @@ void renderLineSummary(raw_ostream &OS, const FileCoverageSummary &Summary) {
 
 void renderBranchSummary(raw_ostream &OS, const FileCoverageSummary &Summary) {
   OS << "BRF:" << Summary.BranchCoverage.getNumBranches() << '\n'
-     << "BFH:" << Summary.BranchCoverage.getCovered() << '\n';
+     << "BRH:" << Summary.BranchCoverage.getCovered() << '\n';
 }
 
 void renderFile(raw_ostream &OS, const coverage::CoverageMapping &Coverage,


        


More information about the llvm-branch-commits mailing list