Skip to content

Commit 8f5a232

Browse files
authored
[llvm-profgen] Trim tail CR+LF for LBR record line (#93210)
On Windows, perfscript generated by sep contains CR+LF at the end of LBR records line. This '\r' will be treated as a LBR record when running llvm-profgen on Linux and then generate warning.
1 parent 06aadbe commit 8f5a232

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/tools/llvm-profgen/PerfReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ bool PerfScriptReader::extractLBRStack(TraceStream &TraceIt,
552552
// ... 0x4005c8/0x4005dc/P/-/-/0
553553
// It's in FIFO order and seperated by whitespace.
554554
SmallVector<StringRef, 32> Records;
555-
TraceIt.getCurrentLine().split(Records, " ", -1, false);
555+
TraceIt.getCurrentLine().rtrim().split(Records, " ", -1, false);
556556
auto WarnInvalidLBR = [](TraceStream &TraceIt) {
557557
WithColor::warning() << "Invalid address in LBR record at line "
558558
<< TraceIt.getLineNumber() << ": "

0 commit comments

Comments
 (0)