diff options
author | Xinliang David Li <davidxl@google.com> | 2017-06-27 17:21:51 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2017-06-27 17:21:51 +0000 |
commit | d6f10a62c6db33cd7d99b850341684c94471bc3f (patch) | |
tree | b5a9168a5f41da7c0bbac33f9f8147f8af5f5168 /llvm/lib/ProfileData | |
parent | 9512332bcb2d2dd10364aa795d4f81e54b8a4a5b (diff) | |
download | bcm5719-llvm-d6f10a62c6db33cd7d99b850341684c94471bc3f.tar.gz bcm5719-llvm-d6f10a62c6db33cd7d99b850341684c94471bc3f.zip |
[ProfData] Make the method threadsafe
llvm-svn: 306428
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 005061c4f06..1dc596fa7ed 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/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. |