#include "CoverageExporterJson.h"
#include "CoverageExporterLcov.h"
#include "CoverageFilters.h"
#include "CoverageReport.h"
#include "CoverageSummaryInfo.h"
#include "CoverageViewOptions.h"
#include "RenderingSupport.h"
#include "SourceCoverageView.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Debuginfod/BuildIDFetcher.h"
#include "llvm/Debuginfod/Debuginfod.h"
#include "llvm/Debuginfod/HTTPClient.h"
#include "llvm/Object/BuildID.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/SpecialCaseList.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/TargetParser/Triple.h"
#include <functional>
#include <map>
#include <optional>
#include <system_error>
usingnamespacellvm;
usingnamespacecoverage;
void exportCoverageDataToJson(const coverage::CoverageMapping &CoverageMapping,
const CoverageViewOptions &Options,
raw_ostream &OS);
namespace {
class CodeCoverageTool { … };
}
static std::string getErrorString(const Twine &Message, StringRef Whence,
bool Warning) { … }
void CodeCoverageTool::error(const Twine &Message, StringRef Whence) { … }
void CodeCoverageTool::warning(const Twine &Message, StringRef Whence) { … }
void CodeCoverageTool::addCollectedPath(const std::string &Path) { … }
void CodeCoverageTool::collectPaths(const std::string &Path) { … }
std::optional<sys::fs::file_status>
CodeCoverageTool::getFileStatus(StringRef FilePath) { … }
bool CodeCoverageTool::isEquivalentFile(StringRef FilePath1,
StringRef FilePath2) { … }
ErrorOr<const MemoryBuffer &>
CodeCoverageTool::getSourceFile(StringRef SourceFile) { … }
void CodeCoverageTool::attachExpansionSubViews(
SourceCoverageView &View, ArrayRef<ExpansionRecord> Expansions,
const CoverageMapping &Coverage) { … }
void CodeCoverageTool::attachBranchSubViews(SourceCoverageView &View,
ArrayRef<CountedRegion> Branches) { … }
void CodeCoverageTool::attachMCDCSubViews(SourceCoverageView &View,
ArrayRef<MCDCRecord> MCDCRecords) { … }
std::unique_ptr<SourceCoverageView>
CodeCoverageTool::createFunctionView(const FunctionRecord &Function,
const CoverageMapping &Coverage) { … }
std::unique_ptr<SourceCoverageView>
CodeCoverageTool::createSourceFileView(StringRef SourceFile,
const CoverageMapping &Coverage) { … }
static bool modifiedTimeGT(StringRef LHS, StringRef RHS) { … }
std::unique_ptr<CoverageMapping> CodeCoverageTool::load() { … }
void CodeCoverageTool::remapPathNames(const CoverageMapping &Coverage) { … }
void CodeCoverageTool::removeUnmappedInputs(const CoverageMapping &Coverage) { … }
void CodeCoverageTool::demangleSymbols(const CoverageMapping &Coverage) { … }
void CodeCoverageTool::writeSourceFileView(StringRef SourceFile,
CoverageMapping *Coverage,
CoveragePrinter *Printer,
bool ShowFilenames) { … }
int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { … }
int CodeCoverageTool::doShow(int argc, const char **argv,
CommandLineParserType commandLineParser) { … }
int CodeCoverageTool::doReport(int argc, const char **argv,
CommandLineParserType commandLineParser) { … }
int CodeCoverageTool::doExport(int argc, const char **argv,
CommandLineParserType commandLineParser) { … }
int showMain(int argc, const char *argv[]) { … }
int reportMain(int argc, const char *argv[]) { … }
int exportMain(int argc, const char *argv[]) { … }