Home | History | Annotate | Download | only in llvm-cov

Lines Matching defs:Coverage

1 //===- CodeCoverage.cpp - Coverage tool based on profiling instrumentation-===//
11 // report coverage information using the profiling instrumentation and code
12 // coverage mapping.
38 using namespace coverage;
41 /// \brief The implementation of the coverage tool.
60 CoverageMapping &Coverage);
64 createFunctionView(const FunctionRecord &Function, CoverageMapping &Coverage);
68 createSourceFileView(StringRef SourceFile, CoverageMapping &Coverage);
70 /// \brief Load the coverage mapping data. Return true if an error occured.
127 CoverageMapping &Coverage) {
131 auto ExpansionCoverage = Coverage.getCoverageForExpansion(Expansion);
141 attachExpansionSubViews(*SubView, SubViewExpansions, Coverage);
148 CoverageMapping &Coverage) {
149 auto FunctionCoverage = Coverage.getCoverageForFunction(Function);
159 attachExpansionSubViews(*View, Expansions, Coverage);
166 CoverageMapping &Coverage) {
170 auto FileCoverage = Coverage.getCoverageForFile(SourceFile);
177 attachExpansionSubViews(*View, Expansions, Coverage);
179 for (auto Function : Coverage.getInstantiations(SourceFile)) {
180 auto SubViewCoverage = Coverage.getCoverageForFunction(*Function);
184 attachExpansionSubViews(*SubView, SubViewExpansions, Coverage);
203 << "error: Failed to load coverage: " << EC.message();
207 auto Coverage = std::move(CoverageOrErr.get());
208 unsigned Mismatched = Coverage->getMismatchedCount();
216 auto CoveredFiles = Coverage.get()->getUniqueSourceFiles();
228 return Coverage;
250 "arch", cl::desc("architecture of the coverage mapping binary"));
257 cl::desc("Treat source files as equivalent to paths in the coverage data "
264 cl::desc("Show code coverage only for functions with the given name"),
269 cl::desc("Show code coverage only for functions that match the given "
274 "region-coverage-lt", cl::Optional,
275 cl::desc("Show code coverage only for functions with region coverage "
280 "region-coverage-gt", cl::Optional,
281 cl::desc("Show code coverage only for functions with region coverage "
286 "line-coverage-lt", cl::Optional,
287 cl::desc("Show code coverage only for functions with line coverage less "
292 "line-coverage-gt", cl::Optional,
293 cl::desc("Show code coverage only for functions with line coverage "
302 cl::ParseCommandLineOptions(argc, argv, "LLVM code coverage tool\n");
412 auto Coverage = load();
413 if (!Coverage)
418 for (const auto &Function : Coverage->getCoveredFunctions()) {
422 auto mainView = createFunctionView(Function, *Coverage);
425 << "warning: Could not read coverage for '" << Function.Name;
442 // Get the source files from the function coverage mapping
443 for (StringRef Filename : Coverage
447 auto mainView = createSourceFileView(SourceFile, *Coverage);
473 auto Coverage = load();
474 if (!Coverage)
477 CoverageReport Report(ViewOpts, std::move(Coverage));