[llvm] r295605 - [llvm-cov] Respect Windows line endings when parsing demangled symbols.

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 19 06:26:54 PST 2017


Author: ikudrin
Date: Sun Feb 19 08:26:52 2017
New Revision: 295605

URL: http://llvm.org/viewvc/llvm-project?rev=295605&view=rev
Log:
[llvm-cov] Respect Windows line endings when parsing demangled symbols.

Differential Revision: https://reviews.llvm.org/D30096

Modified:
    llvm/trunk/tools/llvm-cov/CodeCoverage.cpp

Modified: llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CodeCoverage.cpp?rev=295605&r1=295604&r2=295605&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CodeCoverage.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CodeCoverage.cpp Sun Feb 19 08:26:52 2017
@@ -451,7 +451,9 @@ void CodeCoverageTool::demangleSymbols(c
   // 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,




More information about the llvm-commits mailing list