Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit e3a9558

Browse files
committed
[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
1 parent 395e420 commit e3a9558

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: tools/llvm-cov/CodeCoverage.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,9 @@ void CodeCoverageTool::demangleSymbols(const CoverageMapping &Coverage) {
451451
// Cache the demangled names.
452452
unsigned I = 0;
453453
for (const auto &Function : Coverage.getCoveredFunctions())
454-
DC.DemangledNames[Function.Name] = Symbols[I++];
454+
// On Windows, lines in the demangler's output file end with "\r\n".
455+
// Splitting by '\n' keeps '\r's, so cut them now.
456+
DC.DemangledNames[Function.Name] = Symbols[I++].rtrim();
455457
}
456458

457459
void CodeCoverageTool::writeSourceFileView(StringRef SourceFile,

0 commit comments

Comments
 (0)