#include "SourceCoverageViewHTML.h"
#include "CoverageReport.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ThreadPool.h"
#include <optional>
usingnamespacellvm;
namespace {
std::string escape(StringRef Str, const CoverageViewOptions &Opts) { … }
std::string tag(StringRef Name, StringRef Str, StringRef ClassName = "") { … }
std::string a(StringRef Link, StringRef Str, StringRef TargetName = "") { … }
const char *BeginHeader = …;
const char *JSForCoverage = …;
const char *CSSForCoverage = …;
const char *EndHeader = …;
const char *BeginCenteredDiv = …;
const char *EndCenteredDiv = …;
const char *BeginSourceNameDiv = …;
const char *EndSourceNameDiv = …;
const char *BeginCodeTD = …;
const char *EndCodeTD = …;
const char *BeginPre = …;
const char *EndPre = …;
const char *BeginExpansionDiv = …;
const char *EndExpansionDiv = …;
const char *BeginTable = …;
const char *EndTable = …;
const char *ProjectTitleTag = …;
const char *ReportTitleTag = …;
const char *CreatedTimeTag = …;
std::string getPathToStyle(StringRef ViewPath) { … }
std::string getPathToJavaScript(StringRef ViewPath) { … }
void emitPrelude(raw_ostream &OS, const CoverageViewOptions &Opts,
const std::string &PathToStyle = "",
const std::string &PathToJavaScript = "") { … }
void emitTableRow(raw_ostream &OS, const CoverageViewOptions &Opts,
const std::string &FirstCol, const FileCoverageSummary &FCS,
bool IsTotals) { … }
void emitEpilog(raw_ostream &OS) { … }
}
Expected<CoveragePrinter::OwnedStream>
CoveragePrinterHTML::createViewFile(StringRef Path, bool InToplevel) { … }
void CoveragePrinterHTML::closeViewFile(OwnedStream OS) { … }
static void emitColumnLabelsForIndex(raw_ostream &OS,
const CoverageViewOptions &Opts) { … }
std::string
CoveragePrinterHTML::buildLinkToFile(StringRef SF,
const FileCoverageSummary &FCS) const { … }
Error CoveragePrinterHTML::emitStyleSheet() { … }
Error CoveragePrinterHTML::emitJavaScript() { … }
void CoveragePrinterHTML::emitReportHeader(raw_ostream &OSRef,
const std::string &Title) { … }
void CoveragePrinterHTML::emitFileSummary(raw_ostream &OS, StringRef SF,
const FileCoverageSummary &FCS,
bool IsTotals) const { … }
Error CoveragePrinterHTML::createIndexFile(
ArrayRef<std::string> SourceFiles, const CoverageMapping &Coverage,
const CoverageFiltersMatchAll &Filters) { … }
struct CoveragePrinterHTMLDirectory::Reporter : public DirectoryCoverageReport { … };
Error CoveragePrinterHTMLDirectory::createIndexFile(
ArrayRef<std::string> SourceFiles, const CoverageMapping &Coverage,
const CoverageFiltersMatchAll &Filters) { … }
void SourceCoverageViewHTML::renderViewHeader(raw_ostream &OS) { … }
void SourceCoverageViewHTML::renderViewFooter(raw_ostream &OS) { … }
void SourceCoverageViewHTML::renderSourceName(raw_ostream &OS, bool WholeFile) { … }
void SourceCoverageViewHTML::renderLinePrefix(raw_ostream &OS, unsigned) { … }
void SourceCoverageViewHTML::renderLineSuffix(raw_ostream &OS, unsigned) { … }
void SourceCoverageViewHTML::renderViewDivider(raw_ostream &, unsigned) { … }
void SourceCoverageViewHTML::renderLine(raw_ostream &OS, LineRef L,
const LineCoverageStats &LCS,
unsigned ExpansionCol, unsigned) { … }
void SourceCoverageViewHTML::renderLineCoverageColumn(
raw_ostream &OS, const LineCoverageStats &Line) { … }
void SourceCoverageViewHTML::renderLineNumberColumn(raw_ostream &OS,
unsigned LineNo) { … }
void SourceCoverageViewHTML::renderRegionMarkers(raw_ostream &,
const LineCoverageStats &Line,
unsigned) { … }
void SourceCoverageViewHTML::renderExpansionSite(raw_ostream &OS, LineRef L,
const LineCoverageStats &LCS,
unsigned ExpansionCol,
unsigned ViewDepth) { … }
void SourceCoverageViewHTML::renderExpansionView(raw_ostream &OS,
ExpansionView &ESV,
unsigned ViewDepth) { … }
void SourceCoverageViewHTML::renderBranchView(raw_ostream &OS, BranchView &BRV,
unsigned ViewDepth) { … }
void SourceCoverageViewHTML::renderMCDCView(raw_ostream &OS, MCDCView &MRV,
unsigned ViewDepth) { … }
void SourceCoverageViewHTML::renderInstantiationView(raw_ostream &OS,
InstantiationView &ISV,
unsigned ViewDepth) { … }
void SourceCoverageViewHTML::renderTitle(raw_ostream &OS, StringRef Title) { … }
void SourceCoverageViewHTML::renderTableHeader(raw_ostream &OS,
unsigned ViewDepth) { … }