[llvm] r306428 - [ProfData] Make the method threadsafe

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 10:21:51 PDT 2017


Author: davidxl
Date: Tue Jun 27 10:21:51 2017
New Revision: 306428

URL: http://llvm.org/viewvc/llvm-project?rev=306428&view=rev
Log:
[ProfData] Make the method threadsafe

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

Modified: llvm/trunk/lib/ProfileData/InstrProf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProf.cpp?rev=306428&r1=306427&r2=306428&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProf.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProf.cpp Tue Jun 27 10:21:51 2017
@@ -642,8 +642,9 @@ static ValueProfRecordClosure InstrProfR
 
 // 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.




More information about the llvm-commits mailing list