forked from OSchip/llvm-project
Fix race condition in buildCFG
Summary: switch to sequential execution when print-all is passed. Since the function getDynoStats have an unsafe access to the annotation allocators. (cherry picked from FBD16503502)
This commit is contained in:
parent
6443c46b9d
commit
1bce256e67
|
@ -2781,11 +2781,8 @@ void RewriteInstance::disassembleFunctions() {
|
|||
if (!BF.buildCFG(AllocId))
|
||||
return;
|
||||
|
||||
if (opts::PrintAll) {
|
||||
static std::mutex CriticalSectionMutex;
|
||||
std::lock_guard<std::mutex> Lock(CriticalSectionMutex);
|
||||
if (opts::PrintAll)
|
||||
BF.print(outs(), "while building cfg", true);
|
||||
}
|
||||
};
|
||||
|
||||
ParallelUtilities::PredicateTy SkipPredicate =
|
||||
|
@ -2796,7 +2793,7 @@ void RewriteInstance::disassembleFunctions() {
|
|||
ParallelUtilities::runOnEachFunctionWithUniqueAllocId(
|
||||
*BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,
|
||||
SkipPredicate, "disassembleFunctions-buildCFG",
|
||||
/*ForceSequential*/ opts::SequentialDisassembly);
|
||||
/*ForceSequential*/ opts::SequentialDisassembly || opts::PrintAll);
|
||||
}
|
||||
|
||||
BC->postProcessSymbolTable();
|
||||
|
|
Loading…
Reference in New Issue