[ProfData] Make the method threadsafe

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306428 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Xinliang David Li 2017-06-27 17:21:51 +00:00
parent 423b99d025
commit 65340be3b4

View File

@ -642,8 +642,9 @@ static ValueProfRecordClosure InstrProfRecordClosure = {
// Wrapper implementation using the closure mechanism.
uint32_t ValueProfData::getSize(const InstrProfRecord &Record) {
InstrProfRecordClosure.Record = &Record;
return getValueProfDataSize(&InstrProfRecordClosure);
auto Closure = InstrProfRecordClosure;
Closure.Record = &Record;
return getValueProfDataSize(&Closure);
}
// Wrapper implementation using the closure mechanism.