]> granicus.if.org Git - llvm/commitdiff
[llvm-cov] Respect Windows line endings when parsing demangled symbols.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Sun, 19 Feb 2017 14:26:52 +0000 (14:26 +0000)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Sun, 19 Feb 2017 14:26:52 +0000 (14:26 +0000)
Differential Revision: https://reviews.llvm.org/D30096

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295605 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-cov/CodeCoverage.cpp

index f3f6f9f7fed39bbb5636ddbf9b2c53e5aaa73119..781d1948ccd02211702b190ba403a83fa4931159 100644 (file)
@@ -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,