llvm/llvm/tools/llvm-cov/CoverageReport.cpp

//===- CoverageReport.cpp - Code coverage report -------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This class implements rendering of a code coverage report.
//
//===----------------------------------------------------------------------===//

#include "CoverageReport.h"
#include "RenderingSupport.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/Threading.h"
#include <numeric>

usingnamespacellvm;

namespace {

/// Helper struct which prints trimmed and aligned columns.
struct Column {};

raw_ostream &operator<<(raw_ostream &OS, const Column &Value) {}

Column column(StringRef Str, unsigned Width) {}

template <typename T>
Column column(StringRef Str, unsigned Width, const T &Value) {}

// Specify the default column widths.
size_t FileReportColumns[] =;
size_t FunctionReportColumns[] =;

/// Adjust column widths to fit long file paths and function names.
void adjustColumnWidths(ArrayRef<StringRef> Files,
                        ArrayRef<StringRef> Functions) {}

/// Prints a horizontal divider long enough to cover the given column
/// widths.
void renderDivider(raw_ostream &OS, const CoverageViewOptions &Options, bool isFileReport) {}

/// Return the color which correponds to the coverage percentage of a
/// certain metric.
template <typename T>
raw_ostream::Colors determineCoveragePercentageColor(const T &Info) {}

/// Get the number of redundant path components in each path in \p Paths.
unsigned getNumRedundantPathComponents(ArrayRef<std::string> Paths) {}

/// Determine the length of the longest redundant prefix of the paths in
/// \p Paths.
unsigned getRedundantPrefixLen(ArrayRef<std::string> Paths) {}

/// Determine the length of the longest redundant prefix of the substrs starts
/// from \p LCP in \p Paths. \p Paths can't be empty. If there's only one
/// element in \p Paths, the length of the substr is returned. Note this is
/// differnet from the behavior of the function above.
unsigned getRedundantPrefixLen(ArrayRef<StringRef> Paths, unsigned LCP) {}

} // end anonymous namespace

namespace llvm {

void CoverageReport::render(const FileCoverageSummary &File,
                            raw_ostream &OS) const {}

void CoverageReport::render(const FunctionCoverageSummary &Function,
                            const DemangleCache &DC,
                            raw_ostream &OS) const {}

void CoverageReport::renderFunctionReports(ArrayRef<std::string> Files,
                                           const DemangleCache &DC,
                                           raw_ostream &OS) {}

void CoverageReport::prepareSingleFileReport(const StringRef Filename,
    const coverage::CoverageMapping *Coverage,
    const CoverageViewOptions &Options, const unsigned LCP,
    FileCoverageSummary *FileReport, const CoverageFilter *Filters) {}

std::vector<FileCoverageSummary> CoverageReport::prepareFileReports(
    const coverage::CoverageMapping &Coverage, FileCoverageSummary &Totals,
    ArrayRef<std::string> Files, const CoverageViewOptions &Options,
    const CoverageFilter &Filters) {}

void CoverageReport::renderFileReports(
    raw_ostream &OS, const CoverageFilters &IgnoreFilenameFilters) const {}

void CoverageReport::renderFileReports(
    raw_ostream &OS, ArrayRef<std::string> Files) const {}

void CoverageReport::renderFileReports(
    raw_ostream &OS, ArrayRef<std::string> Files,
    const CoverageFiltersMatchAll &Filters) const {}

void CoverageReport::renderFileReports(
    raw_ostream &OS, const std::vector<FileCoverageSummary> &FileReports,
    const FileCoverageSummary &Totals, bool ShowEmptyFiles) const {}

Expected<FileCoverageSummary> DirectoryCoverageReport::prepareDirectoryReports(
    ArrayRef<std::string> SourceFiles) {}

/// Filter out files in LCPStack.back(), group others by subdirectory name
/// and recurse on them. After returning from all subdirectories, call
/// generateSubDirectoryReport(). \p Files must be non-empty. The
/// FileCoverageSummary of this directory will be added to \p Totals.
Error DirectoryCoverageReport::prepareSubDirectoryReports(
    const ArrayRef<StringRef> &Files, FileCoverageSummary *Totals) {}

} // end namespace llvm