llvm.org GIT mirror llvm / f6b5345
[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 Vedant Kumar 2 years ago
3 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
206206
207207 For source regions that are instantiated multiple times, such as templates in
208208 ``C++``, show each instantiation separately as well as the combined summary.
209 This option is enabled by default.
209210
210211 .. option:: -show-regions
211212
8686 // RUN: FileCheck -check-prefix=HTML-JUMP -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s
8787 // HTML-JUMP:
Source (jump to first uncovered line)
8888 // HTML-JUMP-NOT:
Source (jump to first uncovered line)
89
90 // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -show-instantiations=false -filename-equivalence %s | FileCheck -check-prefix=NO_INSTS %s
91 // NO_INSTS-NOT: {{^ *}}| _Z4funcIbEiT_:
92 // NO_INSTS-NOT: {{^ *}}| _Z4funcIiEiT_:
287287 auto View = SourceCoverageView::create(SourceFile, SourceBuffer.get(),
288288 ViewOpts, std::move(FileCoverage));
289289 attachExpansionSubViews(*View, Expansions, Coverage);
290 if (!ViewOpts.ShowFunctionInstantiations)
291 return View;
290292
291293 for (const auto *Function : Coverage.getInstantiations(SourceFile)) {
292294 std::unique_ptr SubView{nullptr};
695697
696698 cl::opt ShowInstantiations("show-instantiations", cl::Optional,
697699 cl::desc("Show function instantiations"),
698 cl::cat(ViewCategory));
700 cl::init(true), cl::cat(ViewCategory));
699701
700702 cl::opt ShowOutputDirectory(
701703 "output-dir", cl::init(""),