[llvm] r281882 - [llvm-cov] Delete the NonCodeLines field, it was always dead
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 18 18:46:01 PDT 2016
Author: vedantk
Date: Sun Sep 18 20:46:01 2016
New Revision: 281882
URL: http://llvm.org/viewvc/llvm-project?rev=281882&view=rev
Log:
[llvm-cov] Delete the NonCodeLines field, it was always dead
Modified:
llvm/trunk/test/tools/llvm-cov/Inputs/binary-formats.canonical.json
llvm/trunk/test/tools/llvm-cov/Inputs/highlightedRanges.json
llvm/trunk/test/tools/llvm-cov/Inputs/lineExecutionCounts.json
llvm/trunk/test/tools/llvm-cov/Inputs/regionMarkers.json
llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.json
llvm/trunk/test/tools/llvm-cov/Inputs/universal-binary.json
llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp
llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.cpp
llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.h
Modified: llvm/trunk/test/tools/llvm-cov/Inputs/binary-formats.canonical.json
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/binary-formats.canonical.json?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/Inputs/binary-formats.canonical.json (original)
+++ llvm/trunk/test/tools/llvm-cov/Inputs/binary-formats.canonical.json Sun Sep 18 20:46:01 2016
@@ -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}}
Modified: llvm/trunk/test/tools/llvm-cov/Inputs/highlightedRanges.json
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/highlightedRanges.json?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/Inputs/highlightedRanges.json (original)
+++ llvm/trunk/test/tools/llvm-cov/Inputs/highlightedRanges.json Sun Sep 18 20:46:01 2016
@@ -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}}
Modified: llvm/trunk/test/tools/llvm-cov/Inputs/lineExecutionCounts.json
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/lineExecutionCounts.json?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/Inputs/lineExecutionCounts.json (original)
+++ llvm/trunk/test/tools/llvm-cov/Inputs/lineExecutionCounts.json Sun Sep 18 20:46:01 2016
@@ -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}}
Modified: llvm/trunk/test/tools/llvm-cov/Inputs/regionMarkers.json
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/regionMarkers.json?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/Inputs/regionMarkers.json (original)
+++ llvm/trunk/test/tools/llvm-cov/Inputs/regionMarkers.json Sun Sep 18 20:46:01 2016
@@ -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}}
Modified: llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.json
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.json?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.json (original)
+++ llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.json Sun Sep 18 20:46:01 2016
@@ -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}}
Modified: llvm/trunk/test/tools/llvm-cov/Inputs/universal-binary.json
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/universal-binary.json?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/Inputs/universal-binary.json (original)
+++ llvm/trunk/test/tools/llvm-cov/Inputs/universal-binary.json Sun Sep 18 20:46:01 2016
@@ -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}
Modified: llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CoverageExporterJson.cpp Sun Sep 18 20:46:01 2016
@@ -47,17 +47,8 @@
#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();
Modified: llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.cpp?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.cpp Sun Sep 18 20:46:01 2016
@@ -67,7 +67,7 @@ FunctionCoverageSummary::get(const cover
return FunctionCoverageSummary(
Function.Name, Function.ExecutionCount,
RegionCoverageInfo(CoveredRegions, NumCodeRegions),
- LineCoverageInfo(CoveredLines, 0, NumLines));
+ LineCoverageInfo(CoveredLines, NumLines));
}
void FunctionCoverageSummary::update(const FunctionCoverageSummary &Summary) {
Modified: llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.h?rev=281882&r1=281881&r2=281882&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.h (original)
+++ llvm/trunk/tools/llvm-cov/CoverageSummaryInfo.h Sun Sep 18 20:46:01 2016
@@ -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;
}
};
More information about the llvm-commits
mailing list