diff options
| author | Vedant Kumar <vsk@apple.com> | 2016-09-19 01:46:01 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2016-09-19 01:46:01 +0000 |
| commit | b8d0694caa8cd298feac7cba7066f84548e50b0a (patch) | |
| tree | 678082fd5737feaece41a3289a3f9dc23387969c /llvm/tools | |
| parent | 9ed5802680fda58d7aee3475d785923d3a0deab6 (diff) | |
| download | bcm5719-llvm-b8d0694caa8cd298feac7cba7066f84548e50b0a.tar.gz bcm5719-llvm-b8d0694caa8cd298feac7cba7066f84548e50b0a.zip | |
[llvm-cov] Delete the NonCodeLines field, it was always dead
llvm-svn: 281882
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/llvm-cov/CoverageExporterJson.cpp | 12 | ||||
| -rw-r--r-- | llvm/tools/llvm-cov/CoverageSummaryInfo.cpp | 2 | ||||
| -rw-r--r-- | llvm/tools/llvm-cov/CoverageSummaryInfo.h | 18 |
3 files changed, 8 insertions, 24 deletions
diff --git a/llvm/tools/llvm-cov/CoverageExporterJson.cpp b/llvm/tools/llvm-cov/CoverageExporterJson.cpp index e2a798f4e69..e8dee147c00 100644 --- a/llvm/tools/llvm-cov/CoverageExporterJson.cpp +++ b/llvm/tools/llvm-cov/CoverageExporterJson.cpp @@ -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(); diff --git a/llvm/tools/llvm-cov/CoverageSummaryInfo.cpp b/llvm/tools/llvm-cov/CoverageSummaryInfo.cpp index 396cd655ca1..21aa7ff73a0 100644 --- a/llvm/tools/llvm-cov/CoverageSummaryInfo.cpp +++ b/llvm/tools/llvm-cov/CoverageSummaryInfo.cpp @@ -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) { diff --git a/llvm/tools/llvm-cov/CoverageSummaryInfo.h b/llvm/tools/llvm-cov/CoverageSummaryInfo.h index acf240d95de..c04a4d42ccd 100644 --- a/llvm/tools/llvm-cov/CoverageSummaryInfo.h +++ b/llvm/tools/llvm-cov/CoverageSummaryInfo.h @@ -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; } }; |

