summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-09-15 06:44:51 +0000
committerVedant Kumar <vsk@apple.com>2016-09-15 06:44:51 +0000
commita8c396d99f972877831e74c869eeada081bd8bdc (patch)
treec95784da46f4ea6be23a2e404315e52a1ff4f83a /llvm/tools/llvm-cov/SourceCoverageViewText.cpp
parentea1e97b94ccaa25cc71cb0900c3dfd3d00e18b43 (diff)
downloadbcm5719-llvm-a8c396d99f972877831e74c869eeada081bd8bdc.tar.gz
bcm5719-llvm-a8c396d99f972877831e74c869eeada081bd8bdc.zip
[llvm-cov] Hide instantiation views for unexecuted functions
Copying in the full text of the function doesn't help at all when we already know that it's never executed. Just say that it's unexecuted -- the relevant source text has already been printed. llvm-svn: 281589
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewText.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageViewText.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
index 51c6463db30..f5201d9c808 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
@@ -215,7 +215,12 @@ void SourceCoverageViewText::renderInstantiationView(raw_ostream &OS,
unsigned ViewDepth) {
renderLinePrefix(OS, ViewDepth);
OS << ' ';
- ISV.View->print(OS, /*WholeFile=*/false, /*ShowSourceName=*/true, ViewDepth);
+ if (!ISV.View)
+ getOptions().colored_ostream(OS, raw_ostream::RED)
+ << "Unexecuted instantiation: " << ISV.FunctionName << "\n";
+ else
+ ISV.View->print(OS, /*WholeFile=*/false, /*ShowSourceName=*/true,
+ ViewDepth);
}
void SourceCoverageViewText::renderTitle(raw_ostream &OS, StringRef Title) {
OpenPOWER on IntegriCloud