[ProfileData] Fix data racing in merging indexed profiles

There is data racing to the static variable RecordIndex in index profile reader
when merging in multiple threads. Make it a member variable in
IndexedInstrProfReader to fix this.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rong Xu
2017-10-05 17:05:20 +00:00
parent 0292ee9cab
commit 5b4e1784b6
4 changed files with 120 additions and 3 deletions
-2
View File
@@ -733,8 +733,6 @@ Error IndexedInstrProfReader::getFunctionCounts(StringRef FuncName,
}
Error IndexedInstrProfReader::readNextRecord(NamedInstrProfRecord &Record) {
static unsigned RecordIndex = 0;
ArrayRef<NamedInstrProfRecord> Data;
Error E = Index->getRecords(Data);