PGO: fix a bug in parsing pgo data.

When a function has a single counter, we will offset the pointer by 1 when
parsing the next function. If a function has multiple counters, we are
okay after skipping rest of the counters.

llvm-svn: 201456
This commit is contained in:
Manman Ren
2014-02-15 01:29:02 +00:00
parent 465f4bc287
commit f1a6a2d930
2 changed files with 4 additions and 1 deletions

View File

@@ -72,7 +72,7 @@ PGOProfileData::PGOProfileData(CodeGenModule &CGM, std::string Path)
ReportBadPGOData(CGM, "pgo-data file has bad count value");
return;
}
CurPtr = EndPtr + 1;
CurPtr = EndPtr; // Point to '\n'.
FunctionCounts[MangledName] = Count;
MaxCount = Count > MaxCount ? Count : MaxCount;

View File

@@ -116,6 +116,9 @@ big_switch 19
2
2
issue_with_one_counter 1
0
boolean_operators 10
1
100