[dsymutil] Prevent interleaved errors and warnings
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 5 Apr 2023 04:49:55 +0000 (21:49 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 5 Apr 2023 04:57:42 +0000 (21:57 -0700)
commit339a8b7fcd50c649f50daf351a011cd5c187778e
treec85a2c00cff4db2d20e55ab98f9ed09b706f9b04
parent25ad7c958a13c28a234af35abec2ecbd1429fd06
[dsymutil] Prevent interleaved errors and warnings

Use a mutex to protect the printing of errors and warnings and prevents
interleaving. There are two sources of parallelism in dsymutil that
could result in interleaved output: errors from different architectures
being processed in parallel and errors from the analyze and clone steps
which execute in lockstep. This patch addresses both by using a unique
mutex across all error reporting.
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
llvm/tools/dsymutil/DwarfLinkerForBinary.h
llvm/tools/dsymutil/dsymutil.cpp