From: Xinliang David Li Date: Tue, 27 Jun 2017 17:21:51 +0000 (+0000) Subject: [ProfData] Make the method threadsafe X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65340be3b401a4d0b4ae9b16d25492d2f7528da0;p=llvm [ProfData] Make the method threadsafe git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306428 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ProfileData/InstrProf.cpp b/lib/ProfileData/InstrProf.cpp index 005061c4f06..1dc596fa7ed 100644 --- a/lib/ProfileData/InstrProf.cpp +++ b/lib/ProfileData/InstrProf.cpp @@ -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.