Lines Matching +full:html +full:- +full:export

1 //===- CodeCoverage.cpp - Coverage tool based on profiling instrumentation-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
67 /// The export command.
68 Export
123 /// (path-equivalence).
161 /// In -path-equivalence mode, this maps the absolute paths from the coverage
166 /// remapped to, when using -path-equivalence.
187 /// Allowlist from -name-allowlist to be used for filtering.
251 auto Status = F->status();
253 warning(Status.getError().message(), F->path());
257 if (Status->type() == llvm::sys::fs::file_type::regular_file)
258 addCollectedPath(F->path());
266 auto &CachedStatus = It.first->getValue();
290 SourceFile = Loc->second;
340 unsigned CurrentLine = NextBranch->LineStart;
341 while (NextBranch != EndBranch && CurrentLine == NextBranch->LineStart)
360 unsigned CurrentLine = NextRecord->getDecisionRegion().LineEnd;
362 CurrentLine == NextRecord->getDecisionRegion().LineEnd)
421 StringRef Funcname = DC.demangle(Function->Name);
423 if (Function->ExecutionCount > 0) {
435 unsigned FileID = Function->CountedRegions.front().FileID;
437 for (const auto &CR : Function->CountedRegions)
440 View->addInstantiation(Funcname, Line, std::move(SubView));
460 warning("profile data may be out of date - object is newer",
471 unsigned Mismatched = Coverage->getMismatchedCount();
476 for (const auto &HashMismatch : Coverage->getHashMismatches())
477 errs() << "hash-mismatch: "
499 auto nativeWithTrailing = [](StringRef Path) -> std::string {
540 Filename = CovFileName->second;
562 sys::fs::createTemporaryFile("demangle-in", "list", InputFD, InputPath);
579 EC = sys::fs::createTemporaryFile("demangle-out", "list", OutputFD,
615 StringRef DemanglerData = DemanglerBuf->getBuffer();
641 auto OSOrErr = Printer->createViewFile(SourceFile, /*InToplevel=*/false);
648 View->print(*OS.get(), /*Wholefile=*/true,
651 Printer->closeViewFile(std::move(OS));
662 "dump-collected-objects", cl::Optional, cl::Hidden,
669 "dump-collected-paths", cl::Optional, cl::Hidden,
673 "instr-profile", cl::Required, cl::location(this->PGOFilename),
684 "debug-file-directory",
692 "format", cl::desc("Output format for line-based coverage reports"),
695 clEnumValN(CoverageViewOptions::OutputFormat::HTML, "html",
696 "HTML output"),
702 "path-equivalence", cl::Optional,
714 "name-allowlist", cl::Optional,
720 "name-regex", cl::Optional,
726 "ignore-filename-regex", cl::Optional,
732 "region-coverage-lt", cl::Optional,
738 "region-coverage-gt", cl::Optional,
744 "line-coverage-lt", cl::Optional,
750 "line-coverage-gt", cl::Optional,
756 "use-color", cl::desc("Emit colored output (default=autodetect)"),
760 "Xdemangler", cl::desc("<demangler-path>|<demangler-option>"));
763 "show-region-summary", cl::Optional,
768 "show-branch-summary", cl::Optional,
772 cl::opt<bool> MCDCSummary("show-mcdc-summary", cl::Optional,
777 "show-instantiation-summary", cl::Optional,
781 "summary-only", cl::Optional,
782 cl::desc("Export only summary information for each source file"));
785 "num-threads", cl::init(0),
787 cl::alias NumThreadsA("j", cl::desc("Alias for --num-threads"),
791 "compilation-dir", cl::init(""),
795 "check-binary-ids", cl::desc("Fail if an object couldn't be found for a "
798 auto commandLineParser = [&, this](int argc, const char **argv) -> int {
807 this->CheckBinaryIDs = CheckBinaryIDs;
831 case CoverageViewOptions::OutputFormat::HTML:
833 errs() << "Color output cannot be disabled when generating html.\n";
851 "-path-equivalence");
874 // Read in -name-allowlist files.
887 NameFilterer->push_back(std::make_unique<NameCoverageFilter>(Name));
889 NameFilterer->push_back(
892 NameFilterer->push_back(
903 StatFilterer->push_back(std::make_unique<RegionCoverageFilter>(
906 StatFilterer->push_back(std::make_unique<RegionCoverageFilter>(
909 StatFilterer->push_back(std::make_unique<LineCoverageFilter>(
912 StatFilterer->push_back(std::make_unique<LineCoverageFilter>(
963 case Export:
975 "show-line-counts", cl::Optional,
980 "show-regions", cl::Optional,
985 "show-branches", cl::Optional,
994 "show-mcdc", cl::Optional,
999 "show-line-counts-or-regions", cl::Optional,
1004 cl::opt<bool> ShowExpansions("show-expansions", cl::Optional,
1008 cl::opt<bool> ShowInstantiations("show-instantiations", cl::Optional,
1012 cl::opt<bool> ShowDirectoryCoverage("show-directory-coverage", cl::Optional,
1016 cl::opt<bool> ShowCreatedTime("show-created-time", cl::Optional,
1021 "output-dir", cl::init(""),
1023 cl::alias ShowOutputDirectoryA("o", cl::desc("Alias for --output-dir"),
1027 "binary-counters", cl::Optional,
1033 "tab-size", cl::init(2),
1035 "Set tab expansion size for html coverage reports (default = 2)"));
1038 "project-title", cl::Optional,
1042 "coverage-watermark", cl::Optional,
1051 error("lcov format should be used with 'llvm-cov export'.");
1062 "-coverage-watermark");
1072 "-coverage-watermark");
1081 "-coverage-watermark");
1089 "', must be both high and low should be between 0-100, and high "
1091 "-coverage-watermark");
1144 for (StringRef Filename : Coverage->getUniqueSourceFiles()) {
1151 if (Error E = Printer->createIndexFile(SourceFiles, *Coverage, Filters)) {
1162 for (const auto &Function : Coverage->getCoveredFunctions(SourceFile))
1171 auto OSOrErr = Printer->createViewFile(File, /*InToplevel=*/false);
1182 warning("Could not read coverage for '" + Function->Name + "'.");
1185 FunctionView->print(*OS.get(), /*WholeFile=*/false,
1190 Printer->closeViewFile(std::move(OS));
1198 (ViewOpts.Format == CoverageViewOptions::OutputFormat::HTML);
1213 // In -output-dir mode, it's safe to use multiple threads to print files.
1227 "show-functions", cl::Optional, cl::init(false),
1234 if (ViewOpts.Format == CoverageViewOptions::OutputFormat::HTML) {
1235 error("HTML output for summary reports is not yet supported.");
1238 error("lcov format should be used with 'llvm-cov export'.");
1260 error("source files must be specified when -show-functions=true is "
1275 cl::opt<bool> SkipExpansions("skip-expansions", cl::Optional,
1276 cl::desc("Don't export expanded source regions"),
1279 cl::opt<bool> SkipFunctions("skip-functions", cl::Optional,
1280 cl::desc("Don't export per-function data"),
1283 cl::opt<bool> SkipBranches("skip-branches", cl::Optional,
1284 cl::desc("Don't export branch data (LCOV)"),
1321 case CoverageViewOptions::OutputFormat::HTML:
1324 llvm_unreachable("Export in HTML is not supported!");
1332 Exporter->renderRoot(IgnoreFilenameFilters);
1334 Exporter->renderRoot(SourceFiles);
1351 return Tool.run(CodeCoverageTool::Export, argc, argv);