Skip to content

Commit d1638cb

Browse files
committed
[BOLT][NFC] Fix print-cfg data race
Addresses ThreadSanitizer warning Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D121337
1 parent d16bbc5 commit d1638cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2950,8 +2950,10 @@ void RewriteInstance::buildFunctionsCFG() {
29502950
if (!BF.buildCFG(AllocId))
29512951
return;
29522952

2953-
if (opts::PrintAll)
2953+
if (opts::PrintAll) {
2954+
auto L = BC->scopeLock();
29542955
BF.print(outs(), "while building cfg", true);
2956+
}
29552957
};
29562958

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

0 commit comments

Comments
 (0)