aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/SourceCoverageView.h
diff options
context:
space:
mode:
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.