Lines Matching full:coverage
1 //===- CodeCoverage.cpp - Coverage tool based on profiling instrumentation-===//
11 // report coverage information using the profiling instrumentation and code
12 // coverage mapping.
24 #include "llvm/ProfileData/Coverage/CoverageMapping.h"
36 using namespace coverage;
39 /// \brief The implementation of the coverage tool.
70 CoverageMapping &Coverage);
74 createFunctionView(const FunctionRecord &Function, CoverageMapping &Coverage);
78 createSourceFileView(StringRef SourceFile, CoverageMapping &Coverage);
80 /// \brief Load the coverage mapping data. Return true if an error occured.
174 CoverageMapping &Coverage) { in attachExpansionSubViews() argument
178 auto ExpansionCoverage = Coverage.getCoverageForExpansion(Expansion); in attachExpansionSubViews()
189 attachExpansionSubViews(*SubView, SubViewExpansions, Coverage); in attachExpansionSubViews()
196 CoverageMapping &Coverage) { in createFunctionView() argument
197 auto FunctionCoverage = Coverage.getCoverageForFunction(Function); in createFunctionView()
207 attachExpansionSubViews(*View, Expansions, Coverage); in createFunctionView()
214 CoverageMapping &Coverage) { in createSourceFileView() argument
218 auto FileCoverage = Coverage.getCoverageForFile(SourceFile); in createSourceFileView()
225 attachExpansionSubViews(*View, Expansions, Coverage); in createSourceFileView()
227 for (auto Function : Coverage.getInstantiations(SourceFile)) { in createSourceFileView()
228 auto SubViewCoverage = Coverage.getCoverageForFunction(*Function); in createSourceFileView()
233 attachExpansionSubViews(*SubView, SubViewExpansions, Coverage); in createSourceFileView()
265 << "error: Failed to load coverage: " << toString(std::move(E)) << "\n"; in load()
268 auto Coverage = std::move(CoverageOrErr.get()); in load() local
269 unsigned Mismatched = Coverage->getMismatchedCount(); in load()
277 auto CoveredFiles = Coverage.get()->getUniqueSourceFiles(); in load()
289 return Coverage; in load()
306 "arch", cl::desc("architecture of the coverage mapping binary")); in run()
312 "format", cl::desc("Output format for line-based coverage reports"), in run()
322 cl::desc("Treat source files as equivalent to paths in the coverage data " in run()
329 cl::desc("Show code coverage only for functions with the given name"), in run()
334 cl::desc("Show code coverage only for functions that match the given " in run()
339 "region-coverage-lt", cl::Optional, in run()
340 cl::desc("Show code coverage only for functions with region coverage " in run()
345 "region-coverage-gt", cl::Optional, in run()
346 cl::desc("Show code coverage only for functions with region coverage " in run()
351 "line-coverage-lt", cl::Optional, in run()
352 cl::desc("Show code coverage only for functions with line coverage less " in run()
357 "line-coverage-gt", cl::Optional, in run()
358 cl::desc("Show code coverage only for functions with line coverage " in run()
367 cl::ParseCommandLineOptions(argc, argv, "LLVM code coverage tool\n"); in run()
474 cl::desc("Directory in which coverage information is written out")); in show()
498 auto Coverage = load(); in show() local
499 if (!Coverage) in show()
513 for (const auto &Function : Coverage->getCoveredFunctions()) { in show()
517 auto mainView = createFunctionView(Function, *Coverage); in show()
520 << "warning: Could not read coverage for '" << Function.Name << "'." in show()
536 // Get the source files from the function coverage mapping. in show()
537 for (StringRef Filename : Coverage->getUniqueSourceFiles()) in show()
555 Pool.async([this, &SourceFile, &Coverage, &Printer, ShowFilenames] { in show()
556 auto View = createSourceFileView(SourceFile, *Coverage); in show()
591 auto Coverage = load(); in report() local
592 if (!Coverage) in report()
595 CoverageReport Report(ViewOpts, std::move(Coverage)); in report()