Lines Matching +full:- +full:- +full:show +full:- +full:error
1 //===- CodeCoverage.cpp - Coverage tool based on profiling instrumentation-===//
8 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
43 /// \brief The show command.
44 Show, enumerator
49 /// \brief Print the error message to the error output stream.
50 void error(const Twine &Message, StringRef Whence = "");
52 /// \brief Record (but do not print) an error message in a thread-safe way.
55 /// \brief Record (but do not print) a warning message in a thread-safe way.
58 /// \brief Print (and then clear) all deferred error and warning messages.
80 /// \brief Load the coverage mapping data. Return true if an error occured.
87 int show(int argc, const char **argv,
116 std::string Str = (Warning ? "warning" : "error"); in getErrorString()
124 void CodeCoverageTool::error(const Twine &Message, StringRef Whence) { in error() function in CodeCoverageTool
156 SourceFile = Loc->second; in getSourceFile()
231 SourceCoverageView::create(Function->Name, SourceBuffer.get(), ViewOpts, in createSourceFileView()
236 unsigned FileID = Function->CountedRegions.front().FileID; in createSourceFileView()
238 for (const auto &CR : Function->CountedRegions) in createSourceFileView()
241 View->addInstantiation(Function->Name, Line, std::move(SubView)); in createSourceFileView()
260 errs() << "warning: profile data may be out of date - object is newer\n"; in load()
263 if (Error E = CoverageOrErr.takeError()) { in load()
265 << "error: Failed to load coverage: " << toString(std::move(E)) << "\n"; in load()
269 unsigned Mismatched = Coverage->getMismatchedCount(); in load()
277 auto CoveredFiles = Coverage.get()->getUniqueSourceFiles(); in load()
294 cl::Positional, cl::Required, cl::location(this->ObjectFilename), in run()
301 "instr-profile", cl::Required, cl::location(this->PGOFilename), in run()
309 cl::desc("Show internal debug dump")); in run()
312 "format", cl::desc("Output format for line-based coverage reports"), in run()
321 "filename-equivalence", cl::Optional, in run()
329 cl::desc("Show code coverage only for functions with the given name"), in run()
333 "name-regex", cl::Optional, 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()
363 "use-color", cl::desc("Emit colored output (default=autodetect)"), in run()
366 auto commandLineParser = [&, this](int argc, const char **argv) -> int { in run()
380 error("Color output cannot be disabled when generating html."); in run()
389 NameFilterer->push_back(llvm::make_unique<NameCoverageFilter>(Name)); in run()
391 NameFilterer->push_back( in run()
401 StatFilterer->push_back(llvm::make_unique<RegionCoverageFilter>( in run()
404 StatFilterer->push_back(llvm::make_unique<RegionCoverageFilter>( in run()
407 StatFilterer->push_back(llvm::make_unique<LineCoverageFilter>( in run()
410 StatFilterer->push_back(llvm::make_unique<LineCoverageFilter>( in run()
417 errs() << "error: Unknown architecture: " << Arch << "\n"; in run()
426 errs() << "error: " << File << ": " << EC.message(); in run()
435 case Show: in run()
436 return show(argc, argv, commandLineParser); in run()
443 int CodeCoverageTool::show(int argc, const char **argv, in show() function in CodeCoverageTool
449 "show-line-counts", cl::Optional, in show()
450 cl::desc("Show the execution counts for each line"), cl::init(true), in show()
454 "show-regions", cl::Optional, in show()
455 cl::desc("Show the execution counts for each region"), in show()
459 "show-line-counts-or-regions", cl::Optional, in show()
460 cl::desc("Show the execution counts for each line, or the execution " in show()
464 cl::opt<bool> ShowExpansions("show-expansions", cl::Optional, in show()
465 cl::desc("Show expanded source regions"), in show()
468 cl::opt<bool> ShowInstantiations("show-instantiations", cl::Optional, in show()
469 cl::desc("Show function instantiations"), in show()
473 "output-dir", cl::init(""), in show()
475 cl::alias ShowOutputDirectoryA("o", cl::desc("Alias for --output-dir"), in show()
493 error("Could not create output directory!", E.message()); in show()
505 auto OSOrErr = Printer->createViewFile("functions", /*InToplevel=*/true); in show()
506 if (Error E = OSOrErr.takeError()) { in show()
507 error(toString(std::move(E))); in show()
512 // Show functions. in show()
513 for (const auto &Function : Coverage->getCoveredFunctions()) { in show()
525 mainView->print(*OS.get(), /*WholeFile=*/false, /*ShowSourceName=*/true); in show()
528 Printer->closeViewFile(std::move(OS)); in show()
532 // Show files in show()
537 for (StringRef Filename : Coverage->getUniqueSourceFiles()) in show()
542 if (Error E = Printer->createIndexFile(SourceFiles)) { in show()
543 error(toString(std::move(E))); in show()
548 // In -output-dir mode, it's safe to use multiple threads to print files. in show()
562 auto OSOrErr = Printer->createViewFile(SourceFile, /*InToplevel=*/false); in show()
563 if (Error E = OSOrErr.takeError()) { in show()
569 View->print(*OS.get(), /*Wholefile=*/true, in show()
571 Printer->closeViewFile(std::move(OS)); in show()
589 error("HTML output for summary reports is not yet supported."); in report()
605 return Tool.run(CodeCoverageTool::Show, argc, argv); in showMain()