1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[llvm-cov] Minor cleanup. NFC.

llvm-svn: 282280
This commit is contained in:
Vedant Kumar 2016-09-23 18:57:27 +00:00
parent 6d495bce9c
commit ae3dd65db5

View File

@ -298,7 +298,7 @@ static void emitColumnLabelsForIndex(raw_ostream &OS) {
void CoveragePrinterHTML::emitFileSummary(raw_ostream &OS, StringRef SF,
const FileCoverageSummary &FCS,
bool IsTotals) const {
SmallVector<std::string, 4> Columns;
SmallVector<std::string, 8> Columns;
// Format a coverage triple and add the result to the list of columns.
auto AddCoverageTripleToColumn = [&Columns](unsigned Hit, unsigned Total,
@ -318,13 +318,13 @@ void CoveragePrinterHTML::emitFileSummary(raw_ostream &OS, StringRef SF,
// Simplify the display file path, and wrap it in a link if requested.
std::string Filename;
SmallString<128> LinkTextStr(sys::path::relative_path(FCS.Name));
sys::path::remove_dots(LinkTextStr, /*remove_dot_dots=*/true);
sys::path::native(LinkTextStr);
std::string LinkText = escape(LinkTextStr, Opts);
if (IsTotals) {
Filename = LinkText;
Filename = "TOTALS";
} else {
SmallString<128> LinkTextStr(sys::path::relative_path(FCS.Name));
sys::path::remove_dots(LinkTextStr, /*remove_dot_dots=*/true);
sys::path::native(LinkTextStr);
std::string LinkText = escape(LinkTextStr, Opts);
std::string LinkTarget =
escape(getOutputPath(SF, "html", /*InToplevel=*/false), Opts);
Filename = a(LinkTarget, LinkText);