diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-09-20 15:31:56 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-09-20 15:31:56 +0000 |
commit | 953e2407edb956eb846a79fc0dce08d032ea0d66 (patch) | |
tree | 617f3d06bf359ec67e4b312f2755e0453ce6cf9b /llvm/tools/llvm-cov/SourceCoverageView.h | |
parent | f584649ae397396016b1fbfc6fe8d8ea29e2ebf5 (diff) | |
download | llvm-953e2407edb956eb846a79fc0dce08d032ea0d66.zip llvm-953e2407edb956eb846a79fc0dce08d032ea0d66.tar.gz llvm-953e2407edb956eb846a79fc0dce08d032ea0d66.tar.bz2 |
llvm-cov: Disentangle the coverage data logic from the display (NFC)
This splits the logic for actually looking up coverage information
from the logic that displays it. These were tangled rather thoroughly
so this change is a bit large, but it mostly consists of moving things
around. The coverage lookup logic itself now lives in the library,
rather than being spread between the library and the tool.
llvm-svn: 218184
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.h')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageView.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.h b/llvm/tools/llvm-cov/SourceCoverageView.h index 54a11d8..d92a748 100644 --- a/llvm/tools/llvm-cov/SourceCoverageView.h +++ b/llvm/tools/llvm-cov/SourceCoverageView.h @@ -15,7 +15,6 @@ #define LLVM_COV_SOURCECOVERAGEVIEW_H #include "CoverageViewOptions.h" -#include "SourceCoverageDataManager.h" #include "llvm/ProfileData/CoverageMapping.h" #include "llvm/Support/MemoryBuffer.h" #include <vector> @@ -105,14 +104,14 @@ private: const MemoryBuffer &File; const CoverageViewOptions &Options; - std::unique_ptr<SourceCoverageDataManager> RegionManager; + coverage::CoverageData CoverageInfo; std::vector<ExpansionView> ExpansionSubViews; std::vector<InstantiationView> InstantiationSubViews; /// \brief Render a source line with highlighting. void renderLine(raw_ostream &OS, StringRef Line, int64_t LineNumber, - const CoverageSegment *WrappedSegment, - ArrayRef<const CoverageSegment *> Segments, + const coverage::CoverageSegment *WrappedSegment, + ArrayRef<const coverage::CoverageSegment *> Segments, unsigned ExpansionCol); void renderIndent(raw_ostream &OS, unsigned Level); @@ -126,16 +125,18 @@ private: void renderLineNumberColumn(raw_ostream &OS, unsigned LineNo); /// \brief Render all the region's execution counts on a line. - void renderRegionMarkers(raw_ostream &OS, - ArrayRef<const CoverageSegment *> Segments); + void + renderRegionMarkers(raw_ostream &OS, + ArrayRef<const coverage::CoverageSegment *> Segments); static const unsigned LineCoverageColumnWidth = 7; static const unsigned LineNumberColumnWidth = 5; public: SourceCoverageView(const MemoryBuffer &File, - const CoverageViewOptions &Options) - : File(File), Options(Options) {} + const CoverageViewOptions &Options, + coverage::CoverageData &&CoverageInfo) + : File(File), Options(Options), CoverageInfo(std::move(CoverageInfo)) {} const CoverageViewOptions &getOptions() const { return Options; } @@ -154,12 +155,6 @@ public: /// \brief Print the code coverage information for a specific /// portion of a source file to the output stream. void render(raw_ostream &OS, bool WholeFile, unsigned IndentLevel = 0); - - /// \brief Load the coverage information required for rendering - /// from the mapping regions in the data manager. - void load(std::unique_ptr<SourceCoverageDataManager> Data) { - RegionManager = std::move(Data); - } }; } // namespace llvm |