aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-cov/CodeCoverage.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-08-02 23:35:24 +0000
committerVedant Kumar <vsk@apple.com>2017-08-02 23:35:24 +0000
commitf6b53455dfc6d257276e3f088d18fe7edb27c97d (patch)
tree8ee510116734a2e28949fd9c32415a6385c0cece /tools/llvm-cov/CodeCoverage.cpp
parent51c47348285aa98f37466dabc050857e6d48f05d (diff)
[llvm-cov] Respect the value of the -show-instantiations option
Make `-show-instantiations=false` actually skip displaying instantiation sub-views, instead of simply ignoring the option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cov/CodeCoverage.cpp')
-rw-r--r--tools/llvm-cov/CodeCoverage.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp
index 073bd83e7af..c16d7b44ad6 100644
--- a/tools/llvm-cov/CodeCoverage.cpp
+++ b/tools/llvm-cov/CodeCoverage.cpp
@@ -288,6 +288,8 @@ CodeCoverageTool::createSourceFileView(StringRef SourceFile,
auto View = SourceCoverageView::create(SourceFile, SourceBuffer.get(),
ViewOpts, std::move(FileCoverage));
attachExpansionSubViews(*View, Expansions, Coverage);
+ if (!ViewOpts.ShowFunctionInstantiations)
+ return View;
for (const auto *Function : Coverage.getInstantiations(SourceFile)) {
std::unique_ptr<SourceCoverageView> SubView{nullptr};
@@ -696,7 +698,7 @@ int CodeCoverageTool::show(int argc, const char **argv,
cl::opt<bool> ShowInstantiations("show-instantiations", cl::Optional,
cl::desc("Show function instantiations"),
- cl::cat(ViewCategory));
+ cl::init(true), cl::cat(ViewCategory));
cl::opt<std::string> ShowOutputDirectory(
"output-dir", cl::init(""),