summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CoverageSummaryInfo.h
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-09-19 02:00:12 +0000
committerVedant Kumar <vsk@apple.com>2017-09-19 02:00:12 +0000
commitb7fdaf2cd403e99f3079efafc1793e3e7868a245 (patch)
tree3c7d9aba6a9b0731755dd7da5e049d60cef46e14 /llvm/tools/llvm-cov/CoverageSummaryInfo.h
parentef8e05ff07e3ff6b7d9aedb615b12a2ed61b9d01 (diff)
downloadbcm5719-llvm-b7fdaf2cd403e99f3079efafc1793e3e7868a245.tar.gz
bcm5719-llvm-b7fdaf2cd403e99f3079efafc1793e3e7868a245.zip
[llvm-cov] Make report metrics agree with line exec counts, fixes PR34615
Use the same logic as the line-oriented coverage view to determine the number of covered lines in a function. Fixes llvm.org/PR34615. llvm-svn: 313604
Diffstat (limited to 'llvm/tools/llvm-cov/CoverageSummaryInfo.h')
-rw-r--r--llvm/tools/llvm-cov/CoverageSummaryInfo.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/CoverageSummaryInfo.h b/llvm/tools/llvm-cov/CoverageSummaryInfo.h
index 48cd63a21dd..0548f491545 100644
--- a/llvm/tools/llvm-cov/CoverageSummaryInfo.h
+++ b/llvm/tools/llvm-cov/CoverageSummaryInfo.h
@@ -136,6 +136,20 @@ public:
}
};
+/// \brief Coverage statistics for a single line.
+struct LineCoverageStats {
+ uint64_t ExecutionCount;
+ bool HasMultipleRegions;
+ bool Mapped;
+
+ LineCoverageStats(ArrayRef<const coverage::CoverageSegment *> LineSegments,
+ const coverage::CoverageSegment *WrappedSegment);
+
+ bool isMapped() const { return Mapped; }
+
+ bool hasMultipleRegions() const { return HasMultipleRegions; }
+};
+
/// \brief A summary of function's code coverage.
struct FunctionCoverageSummary {
std::string Name;
@@ -154,8 +168,8 @@ struct FunctionCoverageSummary {
/// \brief Compute the code coverage summary for the given function coverage
/// mapping record.
- static FunctionCoverageSummary
- get(const coverage::FunctionRecord &Function);
+ static FunctionCoverageSummary get(const coverage::CoverageMapping &CM,
+ const coverage::FunctionRecord &Function);
/// Compute the code coverage summary for an instantiation group \p Group,
/// given a list of summaries for each instantiation in \p Summaries.
OpenPOWER on IntegriCloud