diff options
author | Vedant Kumar <vsk@apple.com> | 2016-06-24 00:34:48 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-06-24 00:34:48 +0000 |
commit | 60dcb48ad0ecc0b065ca55fdf70f4957518a4cc3 (patch) | |
tree | 04af7deec2bcea57070e9d6312e7299600d151cc /llvm/tools/llvm-cov/SourceCoverageView.h | |
parent | 5b42f4b8f4f20277031a001ed06e80f8d75c3c18 (diff) | |
download | bcm5719-llvm-60dcb48ad0ecc0b065ca55fdf70f4957518a4cc3.tar.gz bcm5719-llvm-60dcb48ad0ecc0b065ca55fdf70f4957518a4cc3.zip |
[llvm-cov] Rename SourceCoverageView::LineCoverageInfo to LineCoverageStats, NFC
Pull LineCoverageInfo out of SourceCoverageView and rename it so that it
doesn't conflict with another class of the same name in
CoverageSummaryInfo.h.
This cuts down on the amount of code we have to move into a `protected`
section of SourceCoverageView for the upcoming html patch. It also makes
the code a bit clearer: having two LineCoverageInfo's is strange.
llvm-svn: 273633
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.h')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageView.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.h b/llvm/tools/llvm-cov/SourceCoverageView.h index 22c87254e7c..49a5f4acdc2 100644 --- a/llvm/tools/llvm-cov/SourceCoverageView.h +++ b/llvm/tools/llvm-cov/SourceCoverageView.h @@ -73,34 +73,34 @@ struct InstantiationView { } }; -/// \brief A code coverage view of a specific source file. -/// It can have embedded coverage views. -class SourceCoverageView { -private: - /// \brief Coverage information for a single line. - struct LineCoverageInfo { - uint64_t ExecutionCount; - unsigned RegionCount; - bool Mapped; +/// \brief Coverage statistics for a single line. +struct LineCoverageStats { + uint64_t ExecutionCount; + unsigned RegionCount; + bool Mapped; - LineCoverageInfo() : ExecutionCount(0), RegionCount(0), Mapped(false) {} + LineCoverageStats() : ExecutionCount(0), RegionCount(0), Mapped(false) {} - bool isMapped() const { return Mapped; } + bool isMapped() const { return Mapped; } - bool hasMultipleRegions() const { return RegionCount > 1; } + bool hasMultipleRegions() const { return RegionCount > 1; } - void addRegionStartCount(uint64_t Count) { - // The max of all region starts is the most interesting value. - addRegionCount(RegionCount ? std::max(ExecutionCount, Count) : Count); - ++RegionCount; - } + void addRegionStartCount(uint64_t Count) { + // The max of all region starts is the most interesting value. + addRegionCount(RegionCount ? std::max(ExecutionCount, Count) : Count); + ++RegionCount; + } - void addRegionCount(uint64_t Count) { - Mapped = true; - ExecutionCount = Count; - } - }; + void addRegionCount(uint64_t Count) { + Mapped = true; + ExecutionCount = Count; + } +}; +/// \brief A code coverage view of a specific source file. +/// It can have embedded coverage views. +class SourceCoverageView { +private: const MemoryBuffer &File; const CoverageViewOptions &Options; coverage::CoverageData CoverageInfo; @@ -118,7 +118,7 @@ private: void renderViewDivider(unsigned Offset, unsigned Length, raw_ostream &OS); /// \brief Render the line's execution count column. - void renderLineCoverageColumn(raw_ostream &OS, const LineCoverageInfo &Line); + void renderLineCoverageColumn(raw_ostream &OS, const LineCoverageStats &Line); /// \brief Render the line number column. void renderLineNumberColumn(raw_ostream &OS, unsigned LineNo); |