From: Vedant Kumar Date: Fri, 23 Sep 2016 18:57:27 +0000 (+0000) Subject: [llvm-cov] Minor cleanup. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c36f315edc0e8713a0294e56bc34f9e02431d394;p=llvm [llvm-cov] Minor cleanup. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282280 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-cov/SourceCoverageViewHTML.cpp b/tools/llvm-cov/SourceCoverageViewHTML.cpp index 5a984cf2eb9..1cb283cdc1d 100644 --- a/tools/llvm-cov/SourceCoverageViewHTML.cpp +++ b/tools/llvm-cov/SourceCoverageViewHTML.cpp @@ -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 Columns; + SmallVector 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);