[llvm] r282280 - [llvm-cov] Minor cleanup. NFC.
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 23 11:57:28 PDT 2016
Author: vedantk
Date: Fri Sep 23 13:57:27 2016
New Revision: 282280
URL: http://llvm.org/viewvc/llvm-project?rev=282280&view=rev
Log:
[llvm-cov] Minor cleanup. NFC.
Modified:
llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp
Modified: llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp?rev=282280&r1=282279&r2=282280&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp (original)
+++ llvm/trunk/tools/llvm-cov/SourceCoverageViewHTML.cpp Fri Sep 23 13:57:27 2016
@@ -298,7 +298,7 @@ static void emitColumnLabelsForIndex(raw
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::emitFileSummar
// 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);
More information about the llvm-commits
mailing list