summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CoverageReport.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-09-09 17:37:11 +0000
committerVedant Kumar <vsk@apple.com>2016-09-09 17:37:11 +0000
commitd938dfb308fe288605c6a24773ab77db8334c54a (patch)
tree0ebbab671541b78b710f2d0ef1ef5e78c9667006 /llvm/tools/llvm-cov/CoverageReport.cpp
parent6a6e459800d6b095401ef0c13ea4f28877bc6e4d (diff)
downloadbcm5719-llvm-d938dfb308fe288605c6a24773ab77db8334c54a.tar.gz
bcm5719-llvm-d938dfb308fe288605c6a24773ab77db8334c54a.zip
[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! llvm-svn: 281062
Diffstat (limited to 'llvm/tools/llvm-cov/CoverageReport.cpp')
-rw-r--r--llvm/tools/llvm-cov/CoverageReport.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/llvm-cov/CoverageReport.cpp b/llvm/tools/llvm-cov/CoverageReport.cpp
index 695e50fef7f..7897971765e 100644
--- a/llvm/tools/llvm-cov/CoverageReport.cpp
+++ b/llvm/tools/llvm-cov/CoverageReport.cpp
@@ -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 FileCoverageSummary &File,
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(
OpenPOWER on IntegriCloud