summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/SourceCoverageView.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-06-24 00:34:51 +0000
committerVedant Kumar <vsk@apple.com>2016-06-24 00:34:51 +0000
commit9d70d0b5ffe1e920ff28d506c8ddaefc5c51bb94 (patch)
treecc96ca39c86e29c58ef437be720034590fb64b3e /llvm/tools/llvm-cov/SourceCoverageView.cpp
parent60dcb48ad0ecc0b065ca55fdf70f4957518a4cc3 (diff)
downloadbcm5719-llvm-9d70d0b5ffe1e920ff28d506c8ddaefc5c51bb94.tar.gz
bcm5719-llvm-9d70d0b5ffe1e920ff28d506c8ddaefc5c51bb94.zip
[llvm-cov] Add SourceNames to SourceCoverageViews, NFC
A SourceName can be a file or a function. It makes sense to attach this information to a SourceCoverageView, seeing as views (1) already point to the text corresponding to the relevant source code and (2) are already used to render that text along with the SourceNames. This is a nice cleanup which is independent of the upcoming html patch. While we're at it, document the fields in SourceCoverageView. llvm-svn: 273634
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageView.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp
index 0d28006c018..fb5dcb325ca 100644
--- a/llvm/tools/llvm-cov/SourceCoverageView.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp
@@ -250,9 +250,7 @@ void SourceCoverageView::render(raw_ostream &OS, bool WholeFile,
OS << "\n";
renderIndent(OS, NestedIndent);
OS << ' ';
- Options.colored_ostream(OS, raw_ostream::CYAN) << NextISV->FunctionName
- << ":";
- OS << "\n";
+ NextISV->View->renderSourceName(OS);
NextISV->View->render(OS, false, NestedIndent);
RenderedSubView = true;
}
@@ -262,3 +260,8 @@ void SourceCoverageView::render(raw_ostream &OS, bool WholeFile,
}
}
}
+
+void SourceCoverageView::renderSourceName(raw_ostream &OS) {
+ getOptions().colored_ostream(OS, raw_ostream::CYAN) << getSourceName()
+ << ":\n";
+}
OpenPOWER on IntegriCloud