summaryrefslogtreecommitdiff
path: root/tools/llvm-cov/CodeCoverage.cpp
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin@accesssoftek.com>2017-02-19 14:26:52 +0000
committerIgor Kudrin <ikudrin@accesssoftek.com>2017-02-19 14:26:52 +0000
commite3a9558370a1caf41c0f206ecbb26dbd22a39a8f (patch)
tree6a16bf344d66a999983087957807c484a933f567 /tools/llvm-cov/CodeCoverage.cpp
parent395e4206ab18e394621030f8f68a5d533848df72 (diff)
[llvm-cov] Respect Windows line endings when parsing demangled symbols.
Differential Revision: https://reviews.llvm.org/D30096 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cov/CodeCoverage.cpp')
-rw-r--r--tools/llvm-cov/CodeCoverage.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp
index f3f6f9f7fed..781d1948ccd 100644
--- a/tools/llvm-cov/CodeCoverage.cpp
+++ b/tools/llvm-cov/CodeCoverage.cpp
@@ -451,7 +451,9 @@ void CodeCoverageTool::demangleSymbols(const CoverageMapping &Coverage) {
// Cache the demangled names.
unsigned I = 0;
for (const auto &Function : Coverage.getCoveredFunctions())
- DC.DemangledNames[Function.Name] = Symbols[I++];
+ // On Windows, lines in the demangler's output file end with "\r\n".
+ // Splitting by '\n' keeps '\r's, so cut them now.
+ DC.DemangledNames[Function.Name] = Symbols[I++].rtrim();
}
void CodeCoverageTool::writeSourceFileView(StringRef SourceFile,