summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-06-25 05:48:59 +0000
committerVedant Kumar <vsk@apple.com>2016-06-25 05:48:59 +0000
commit5e86ac74a4bfdd18ae3f7ad193af00bac47bdb20 (patch)
tree97cb2b0d2d1fc63db6068f87ca73b3bbc3ac2db1
parenta6154f98d5ff6d824e925e7773f41f05e9f32d2f (diff)
[llvm-cov] Make an API more consistent, NFC
Make renderExpansionView() look a bit more like renderLine(), and clarify its doxygen comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273773 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/llvm-cov/SourceCoverageView.cpp2
-rw-r--r--tools/llvm-cov/SourceCoverageView.h14
-rw-r--r--tools/llvm-cov/SourceCoverageViewText.cpp6
-rw-r--r--tools/llvm-cov/SourceCoverageViewText.h4
4 files changed, 14 insertions, 12 deletions
diff --git a/tools/llvm-cov/SourceCoverageView.cpp b/tools/llvm-cov/SourceCoverageView.cpp
index 285767e322c..45684d78e31 100644
--- a/tools/llvm-cov/SourceCoverageView.cpp
+++ b/tools/llvm-cov/SourceCoverageView.cpp
@@ -133,7 +133,7 @@ void SourceCoverageView::print(raw_ostream &OS, bool WholeFile,
OS, *NextESV,
RenderedSubView ? Optional<LineRef>({*LI, LI.line_number()})
: Optional<LineRef>(),
- ExpansionColumn, WrappedSegment, LineSegments, ViewDepth);
+ WrappedSegment, LineSegments, ExpansionColumn, ViewDepth);
RenderedSubView = true;
}
for (; NextISV != EndISV && NextISV->Line == LI.line_number(); ++NextISV) {
diff --git a/tools/llvm-cov/SourceCoverageView.h b/tools/llvm-cov/SourceCoverageView.h
index 82822ca9ee3..763529a476b 100644
--- a/tools/llvm-cov/SourceCoverageView.h
+++ b/tools/llvm-cov/SourceCoverageView.h
@@ -163,12 +163,14 @@ protected:
CoverageSegmentArray Segments,
unsigned ViewDepth) = 0;
- /// \brief Render an expansion view. If \p FirstLine is provided, it points
- /// to the expansion site, which must be re-rendered for clarity.
- virtual unsigned renderExpansionView(
- raw_ostream &OS, ExpansionView &ESV, Optional<LineRef> FirstLine,
- unsigned ExpansionCol, const coverage::CoverageSegment *WrappedSegment,
- CoverageSegmentArray LineSegments, unsigned ViewDepth) = 0;
+ /// \brief Render an expansion view. If the expansion site must be re-rendered
+ /// for clarity, it is passed in via \p FirstLine.
+ virtual unsigned
+ renderExpansionView(raw_ostream &OS, ExpansionView &ESV,
+ Optional<LineRef> FirstLine,
+ const coverage::CoverageSegment *WrappedSegment,
+ CoverageSegmentArray Segments, unsigned ExpansionCol,
+ unsigned ViewDepth) = 0;
/// \brief Render an instantiation view.
virtual void renderInstantiationView(raw_ostream &OS, InstantiationView &ISV,
diff --git a/tools/llvm-cov/SourceCoverageViewText.cpp b/tools/llvm-cov/SourceCoverageViewText.cpp
index c1f281ce71d..e02f4b1ae42 100644
--- a/tools/llvm-cov/SourceCoverageViewText.cpp
+++ b/tools/llvm-cov/SourceCoverageViewText.cpp
@@ -158,8 +158,8 @@ void SourceCoverageViewText::renderRegionMarkers(
unsigned SourceCoverageViewText::renderExpansionView(
raw_ostream &OS, ExpansionView &ESV, Optional<LineRef> FirstLine,
- unsigned ExpansionCol, const coverage::CoverageSegment *WrappedSegment,
- CoverageSegmentArray LineSegments, unsigned ViewDepth) {
+ const coverage::CoverageSegment *WrappedSegment,
+ CoverageSegmentArray Segments, unsigned ExpansionCol, unsigned ViewDepth) {
unsigned NextExpansionCol = ExpansionCol;
if (FirstLine.hasValue()) {
@@ -168,7 +168,7 @@ unsigned SourceCoverageViewText::renderExpansionView(
NextExpansionCol = ESV.getStartCol();
renderLinePrefix(OS, ViewDepth);
OS.indent(getCombinedColumnWidth(getOptions()) + (ViewDepth == 0 ? 0 : 1));
- renderLine(OS, *FirstLine, WrappedSegment, LineSegments, ExpansionCol,
+ renderLine(OS, *FirstLine, WrappedSegment, Segments, ExpansionCol,
ViewDepth);
renderViewDivider(OS, ViewDepth + 1);
}
diff --git a/tools/llvm-cov/SourceCoverageViewText.h b/tools/llvm-cov/SourceCoverageViewText.h
index 6753a59c35d..36b7c9659c2 100644
--- a/tools/llvm-cov/SourceCoverageViewText.h
+++ b/tools/llvm-cov/SourceCoverageViewText.h
@@ -33,9 +33,9 @@ class SourceCoverageViewText : public SourceCoverageView {
unsigned renderExpansionView(raw_ostream &OS, ExpansionView &ESV,
Optional<LineRef> FirstLine,
- unsigned ExpansionCol,
const coverage::CoverageSegment *WrappedSegment,
- CoverageSegmentArray LineSegments,
+ CoverageSegmentArray Segments,
+ unsigned ExpansionCol,
unsigned ViewDepth) override;
void renderInstantiationView(raw_ostream &OS, InstantiationView &ISV,