]> granicus.if.org Git - llvm/commitdiff
[llvm-cov] Delete the NonCodeLines field, it was always dead
authorVedant Kumar <vsk@apple.com>
Mon, 19 Sep 2016 01:46:01 +0000 (01:46 +0000)
committerVedant Kumar <vsk@apple.com>
Mon, 19 Sep 2016 01:46:01 +0000 (01:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281882 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-cov/Inputs/binary-formats.canonical.json
test/tools/llvm-cov/Inputs/highlightedRanges.json
test/tools/llvm-cov/Inputs/lineExecutionCounts.json
test/tools/llvm-cov/Inputs/regionMarkers.json
test/tools/llvm-cov/Inputs/showExpansions.json
test/tools/llvm-cov/Inputs/universal-binary.json
tools/llvm-cov/CoverageExporterJson.cpp
tools/llvm-cov/CoverageSummaryInfo.cpp
tools/llvm-cov/CoverageSummaryInfo.h

index 276bbfa4e30a3f90445ad6a65196f13d4074f3ba..46ada64e731915a213dea8f7f9d3baa03a95b944 100644 (file)
@@ -1,5 +1,5 @@
 // Metadata section
-// CHECK: {"version":"1.0.0","type":"llvm.coverage.json.export","data":[
+// CHECK: {"version":"1.1.0","type":"llvm.coverage.json.export","data":[
 
 // Open Export
 // CHECK-SAME: {"object":"{{[^"]+}}","files":[
@@ -12,7 +12,7 @@
 
 // Verify the Summary Section for the first file
 // CHECK-SAME: "summary":{
-// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100,"noncode":0},
+// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":1,"covered":1,"notcovered":0,"percent":100}}}
 
@@ -30,7 +30,7 @@
 
 // Full Export Summary
 // CHECK-SAME: "totals":{
-// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100,"noncode":0},
+// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "instantiations":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":1,"covered":1,"notcovered":0,"percent":100}}
index 0ef3cde17d22196622f431a9ba04ba01111cf6fd..ddd472e44ec93a029547b6ce4c9b0a5250301f73 100644 (file)
@@ -1,5 +1,5 @@
 // Metadata section
-// CHECK: {"version":"1.0.0","type":"llvm.coverage.json.export","data":[
+// CHECK: {"version":"1.1.0","type":"llvm.coverage.json.export","data":[
 
 // Open Export
 // CHECK-SAME: {"object":"{{[^"]+}}","files":[
@@ -12,7 +12,7 @@
 
 // Verify the Summary Section for the first file
 // CHECK-SAME: "summary":{
-// CHECK-SAME: "lines":{"count":40,"covered":26,"percent":65,"noncode":0},
+// CHECK-SAME: "lines":{"count":40,"covered":26,"percent":65},
 // CHECK-SAME: "functions":{"count":4,"covered":4,"percent":100},
 // CHECK-SAME: "regions":{"count":19,"covered":11,"notcovered":8,"percent":57}}}
 
@@ -45,7 +45,7 @@
 
 // Full Export Summary
 // CHECK-SAME: "totals":{
-// CHECK-SAME: "lines":{"count":40,"covered":26,"percent":65,"noncode":0},
+// CHECK-SAME: "lines":{"count":40,"covered":26,"percent":65},
 // CHECK-SAME: "functions":{"count":4,"covered":4,"percent":100},
 // CHECK-SAME: "instantiations":{"count":4,"covered":4,"percent":100},
 // CHECK-SAME: "regions":{"count":19,"covered":11,"notcovered":8,"percent":57}}
index ff1c8f59dbad9fede0a14c47aa4adec082360782..e07d0982677bc17e24c661670bb36ea1274ea732 100644 (file)
@@ -1,5 +1,5 @@
 // Metadata section
-// CHECK: {"version":"1.0.0","type":"llvm.coverage.json.export","data":[
+// CHECK: {"version":"1.1.0","type":"llvm.coverage.json.export","data":[
 
 // Open Export
 // CHECK-SAME: {"object":"{{[^"]+}}","files":[
@@ -12,7 +12,7 @@
 
 // Verify the Summary Section for the first file
 // CHECK-SAME: "summary":{
-// CHECK-SAME: "lines":{"count":20,"covered":16,"percent":80,"noncode":0},
+// CHECK-SAME: "lines":{"count":20,"covered":16,"percent":80},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":10,"covered":7,"notcovered":3,"percent":70}}}
 
@@ -30,7 +30,7 @@
 
 // Full Export Summary
 // CHECK-SAME: "totals":{
-// CHECK-SAME: "lines":{"count":20,"covered":16,"percent":80,"noncode":0},
+// CHECK-SAME: "lines":{"count":20,"covered":16,"percent":80},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "instantiations":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":10,"covered":7,"notcovered":3,"percent":70}}
index 5bc506e40713e827cb34292f621d69fa13b95e66..9048768c8eef1d2b667aff41bb639acc24b256cc 100644 (file)
@@ -1,5 +1,5 @@
 // Metadata section
-// CHECK: {"version":"1.0.0","type":"llvm.coverage.json.export","data":[
+// CHECK: {"version":"1.1.0","type":"llvm.coverage.json.export","data":[
 
 // Open Export
 // CHECK-SAME: {"object":"{{[^"]+}}","files":[
@@ -12,7 +12,7 @@
 
 // Verify the Summary Section for the first file
 // CHECK-SAME: "summary":{
-// CHECK-SAME: "lines":{"count":21,"covered":17,"percent":80,"noncode":0},
+// CHECK-SAME: "lines":{"count":21,"covered":17,"percent":80},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":10,"covered":7,"notcovered":3,"percent":70}}
 
@@ -29,7 +29,7 @@
 
 // Full Export Summary
 // CHECK-SAME: "totals":{
-// CHECK-SAME: "lines":{"count":21,"covered":17,"percent":80,"noncode":0},
+// CHECK-SAME: "lines":{"count":21,"covered":17,"percent":80},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "instantiations":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":10,"covered":7,"notcovered":3,"percent":70}}
index 4a5bb9037fae5f9487631dae51c1c9e3f9b10356..6821fd6ac8a1ed200ab881870ff94beed38a1756 100644 (file)
@@ -1,5 +1,5 @@
 // Metadata section
-// CHECK: {"version":"1.0.0","type":"llvm.coverage.json.export","data":[
+// CHECK: {"version":"1.1.0","type":"llvm.coverage.json.export","data":[
 
 // Open Export
 // CHECK-SAME: {"object":"{{[^"]+}}","files":[
@@ -22,7 +22,7 @@
 
 // Verify the Summary Section for the first file
 // CHECK-SAME: "summary":{
-// CHECK-SAME: "lines":{"count":17,"covered":15,"percent":88,"noncode":0},
+// CHECK-SAME: "lines":{"count":17,"covered":15,"percent":88},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":13,"covered":12,"notcovered":1,"percent":92}}
 
@@ -43,7 +43,7 @@
 
 // Full Export Summary
 // CHECK-SAME: "totals":{
-// CHECK-SAME: "lines":{"count":17,"covered":15,"percent":88,"noncode":0},
+// CHECK-SAME: "lines":{"count":17,"covered":15,"percent":88},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "instantiations":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":13,"covered":12,"notcovered":1,"percent":92}}
index edf09f374f7a6cd91147d3eea9e7a57b75c699de..ec32adbe2a59eb72681ac0e464f5d8790b18e79b 100644 (file)
@@ -1,5 +1,5 @@
 // Metadata section
-// CHECK: {"version":"1.0.0","type":"llvm.coverage.json.export","data":[
+// CHECK: {"version":"1.1.0","type":"llvm.coverage.json.export","data":[
 
 // Open Export
 // CHECK-SAME: {"object":"{{[^"]+}}","files":[
@@ -12,7 +12,7 @@
 
 // Verify the Summary Section for the first file
 // CHECK-SAME: "summary":{
-// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100,"noncode":0},
+// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":1,"covered":1,"notcovered":0,"percent":100}}
 
@@ -28,7 +28,7 @@
 
 // Full Export Summary
 // CHECK-SAME: "totals":{
-// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100,"noncode":0},
+// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "instantiations":{"count":1,"covered":1,"percent":100},
 // CHECK-SAME: "regions":{"count":1,"covered":1,"notcovered":0,"percent":100}
index e2a798f4e692ceef6be95116c141d3490c9ac478..e8dee147c00045c7965e9f8bcd954af93f97f8a3 100644 (file)
 #include "llvm/ProfileData/Coverage/CoverageMapping.h"
 #include <stack>
 
-/// \brief Major version of the JSON Coverage Export Format.
-#define LLVM_COVERAGE_EXPORT_JSON_MAJOR 1
-
-/// \brief Minor version of the JSON Coverage Export Format.
-#define LLVM_COVERAGE_EXPORT_JSON_MINOR 0
-
-/// \brief Patch version of the JSON Coverage Export Format.
-#define LLVM_COVERAGE_EXPORT_JSON_PATCH 0
-
 /// \brief The semantic version combined as a string.
-#define LLVM_COVERAGE_EXPORT_JSON_STR "1.0.0"
+#define LLVM_COVERAGE_EXPORT_JSON_STR "1.1.0"
 
 /// \brief Unique type identifier for JSON coverage export.
 #define LLVM_COVERAGE_EXPORT_JSON_TYPE_STR "llvm.coverage.json.export"
@@ -377,7 +368,6 @@ class CoverageExporterJson {
     emitDictElement("count", Summary.LineCoverage.NumLines);
     emitDictElement("covered", Summary.LineCoverage.Covered);
     emitDictElement("percent", Summary.LineCoverage.getPercentCovered());
-    emitDictElement("noncode", Summary.LineCoverage.NonCodeLines);
     // End Line Coverage Summary.
     emitDictEnd();
 
index 396cd655ca1f89f64f3b32df650d7803196f77d5..21aa7ff73a05628870d80894a0ad8d5c5841056e 100644 (file)
@@ -67,7 +67,7 @@ FunctionCoverageSummary::get(const coverage::FunctionRecord &Function) {
   return FunctionCoverageSummary(
       Function.Name, Function.ExecutionCount,
       RegionCoverageInfo(CoveredRegions, NumCodeRegions),
-      LineCoverageInfo(CoveredLines, 0, NumLines));
+      LineCoverageInfo(CoveredLines, NumLines));
 }
 
 void FunctionCoverageSummary::update(const FunctionCoverageSummary &Summary) {
index acf240d95de5a6511217dcdcb80313392efdd147..c04a4d42ccd7417df48a59bb2d10297bdeeecafc 100644 (file)
@@ -61,33 +61,27 @@ struct LineCoverageInfo {
   /// \brief The number of lines that weren't executed.
   size_t NotCovered;
 
-  /// \brief The number of lines that aren't code.
-  size_t NonCodeLines;
-
   /// \brief The total number of lines in a function/file.
   size_t NumLines;
 
-  LineCoverageInfo()
-      : Covered(0), NotCovered(0), NonCodeLines(0), NumLines(0) {}
+  LineCoverageInfo() : Covered(0), NotCovered(0), NumLines(0) {}
 
-  LineCoverageInfo(size_t Covered, size_t NumNonCodeLines, size_t NumLines)
-      : Covered(Covered), NotCovered(NumLines - NumNonCodeLines - Covered),
-        NonCodeLines(NumNonCodeLines), NumLines(NumLines) {}
+  LineCoverageInfo(size_t Covered, size_t NumLines)
+      : Covered(Covered), NotCovered(NumLines - Covered), NumLines(NumLines) {}
 
   LineCoverageInfo &operator+=(const LineCoverageInfo &RHS) {
     Covered += RHS.Covered;
     NotCovered += RHS.NotCovered;
-    NonCodeLines += RHS.NonCodeLines;
     NumLines += RHS.NumLines;
     return *this;
   }
 
-  bool isFullyCovered() const { return Covered == (NumLines - NonCodeLines); }
+  bool isFullyCovered() const { return Covered == NumLines; }
 
   double getPercentCovered() const {
-    if (NumLines - NonCodeLines == 0)
+    if (NumLines == 0)
       return 0.0;
-    return double(Covered) / double(NumLines - NonCodeLines) * 100.0;
+    return double(Covered) / double(NumLines) * 100.0;
   }
 };