[llvm] r268818 - [PGO] Use rsplit to parse value-data line in text profile file.

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 16:20:59 PDT 2016


Author: xur
Date: Fri May  6 18:20:58 2016
New Revision: 268818

URL: http://llvm.org/viewvc/llvm-project?rev=268818&view=rev
Log:
[PGO] Use rsplit to parse value-data line in text profile file.
The value-data line is <PGOFuncName>:<Count_Value>. PGOFuncName might contain
':' for the internal linkage functions. We therefore need to use rsplit,
rather split, to extract the data from the line. This fixes the error when
merging a text profile file to an indexed profile file.

Modified:
    llvm/trunk/lib/ProfileData/InstrProfReader.cpp

Modified: llvm/trunk/lib/ProfileData/InstrProfReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=268818&r1=268817&r2=268818&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProfReader.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProfReader.cpp Fri May  6 18:20:58 2016
@@ -174,7 +174,7 @@ TextInstrProfReader::readValueProfileDat
       std::vector<InstrProfValueData> CurrentValues;
       for (uint32_t V = 0; V < NumValueData; V++) {
         CHECK_LINE_END(Line);
-        std::pair<StringRef, StringRef> VD = Line->split(':');
+        std::pair<StringRef, StringRef> VD = Line->rsplit(':');
         uint64_t TakenCount, Value;
         if (VK == IPVK_IndirectCallTarget) {
           Symtab->addFuncName(VD.first);




More information about the llvm-commits mailing list