Skip to content

Commit

Permalink
[BOLT][NFC] Fix print-cfg data race
Browse files Browse the repository at this point in the history
Addresses ThreadSanitizer warning

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121337
  • Loading branch information
aaupov committed Mar 10, 2022
1 parent d16bbc5 commit d1638cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2950,8 +2950,10 @@ void RewriteInstance::buildFunctionsCFG() {
if (!BF.buildCFG(AllocId))
return;

if (opts::PrintAll)
if (opts::PrintAll) {
auto L = BC->scopeLock();
BF.print(outs(), "while building cfg", true);
}
};

ParallelUtilities::PredicateTy SkipPredicate = [&](const BinaryFunction &BF) {
Expand Down

0 comments on commit d1638cb

Please sign in to comment.