aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/SourceCoverageView.h
diff options
context:
space:
mode:
authorYing Yi <maggieyi666@gmail.com>2016-08-24 14:27:23 +0000
committerYing Yi <maggieyi666@gmail.com>2016-08-24 14:27:23 +0000
commit84dc971ee2bc444a41d01051dba5b83d103ad952 (patch)
treeed2637dc11ef83639d3aa81a281d6463dc8882fd /llvm/tools/llvm-cov/SourceCoverageView.h
parentc22e32deac405e042ffe4f05bf01bd5b6e3aa536 (diff)
downloadllvm-84dc971ee2bc444a41d01051dba5b83d103ad952.zip
llvm-84dc971ee2bc444a41d01051dba5b83d103ad952.tar.gz
llvm-84dc971ee2bc444a41d01051dba5b83d103ad952.tar.bz2
[llvm-cov] Add the project summary to each source file coverage report.
This patch includes the following changes: - Included header "Code coverage report" and include the date that the report was created. - Included title (as specified in a command line option, (i.e llvm-cov -project-title="Simple Test") - In the summary, list the elf files that the source code file has contributed to. - Used column heading for "Line No.", "Count No.", Source". Differential Revision: https://reviews.llvm.org/D23345 llvm-svn: 279628
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.h')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageView.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.h b/llvm/tools/llvm-cov/SourceCoverageView.h
index 6f2c400..eb820e3 100644
--- a/llvm/tools/llvm-cov/SourceCoverageView.h
+++ b/llvm/tools/llvm-cov/SourceCoverageView.h
@@ -172,6 +172,9 @@ class SourceCoverageView {
/// on display.
std::vector<InstantiationView> InstantiationSubViews;
+ /// Specifies whether or not the view is a function view.
+ bool FunctionView;
+
protected:
struct LineRef {
StringRef Line;
@@ -192,7 +195,7 @@ protected:
virtual void renderViewFooter(raw_ostream &OS) = 0;
/// \brief Render the source name for the view.
- virtual void renderSourceName(raw_ostream &OS) = 0;
+ virtual void renderSourceName(raw_ostream &OS, bool WholeFile) = 0;
/// \brief Render the line prefix at the given \p ViewDepth.
virtual void renderLinePrefix(raw_ostream &OS, unsigned ViewDepth) = 0;
@@ -236,6 +239,13 @@ protected:
virtual void renderInstantiationView(raw_ostream &OS, InstantiationView &ISV,
unsigned ViewDepth) = 0;
+ /// \brief Render the project title, the report title \p CellText and the
+ /// created time for the view.
+ virtual void renderCellInTitle(raw_ostream &OS, StringRef CellText) = 0;
+
+ /// \brief Render the table header for a given source file
+ virtual void renderTableHeader(raw_ostream &OS, unsigned IndentLevel = 0) = 0;
+
/// @}
/// \brief Format a count using engineering notation with 3 significant
@@ -250,20 +260,22 @@ protected:
SourceCoverageView(StringRef SourceName, const MemoryBuffer &File,
const CoverageViewOptions &Options,
- coverage::CoverageData &&CoverageInfo)
+ coverage::CoverageData &&CoverageInfo, bool FunctionView)
: SourceName(SourceName), File(File), Options(Options),
- CoverageInfo(std::move(CoverageInfo)) {}
+ CoverageInfo(std::move(CoverageInfo)), FunctionView(FunctionView) {}
public:
static std::unique_ptr<SourceCoverageView>
create(StringRef SourceName, const MemoryBuffer &File,
const CoverageViewOptions &Options,
- coverage::CoverageData &&CoverageInfo);
+ coverage::CoverageData &&CoverageInfo, bool FucntionView = false);
virtual ~SourceCoverageView() {}
StringRef getSourceName() const { return SourceName; }
+ bool isFunctionView() const { return FunctionView; }
+
const CoverageViewOptions &getOptions() const { return Options; }
/// \brief Add an expansion subview to this view.