[llvm] r281062 - [llvm-cov] Handle native paths correctly in the text index
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 9 10:37:11 PDT 2016
Author: vedantk
Date: Fri Sep 9 12:37:11 2016
New Revision: 281062
URL: http://llvm.org/viewvc/llvm-project?rev=281062&view=rev
Log:
[llvm-cov] Handle native paths correctly in the text index
Treat filenames the same way in the text index as we do in the html
index. This is a follow-up to r281008 (an attempt to unbreak the
native_separators.c test on Windows).
Patch by Maggie Yi!
Modified:
llvm/trunk/tools/llvm-cov/CoverageReport.cpp
Modified: llvm/trunk/tools/llvm-cov/CoverageReport.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CoverageReport.cpp?rev=281062&r1=281061&r2=281062&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CoverageReport.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CoverageReport.cpp Fri Sep 9 12:37:11 2016
@@ -15,6 +15,7 @@
#include "RenderingSupport.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
+#include "llvm/Support/Path.h"
#include <numeric>
using namespace llvm;
@@ -140,7 +141,10 @@ void CoverageReport::render(const FileCo
auto FuncCoverageColor =
determineCoveragePercentageColor(File.FunctionCoverage);
auto LineCoverageColor = determineCoveragePercentageColor(File.LineCoverage);
- OS << column(File.Name, FileReportColumns[0], Column::NoTrim)
+ SmallString<256> FileName = File.Name;
+ sys::path::remove_dots(FileName, /*remove_dot_dots=*/true);
+ sys::path::native(FileName);
+ OS << column(FileName, FileReportColumns[0], Column::NoTrim)
<< format("%*u", FileReportColumns[1],
(unsigned)File.RegionCoverage.NumRegions);
Options.colored_ostream(OS, FileCoverageColor) << format(
More information about the llvm-commits
mailing list