Workaround -Wglobal-constructor warning. (#94699)

This line was tripping the -Wglobal-constructor warning which was
causing a build failure when -Werror was turned on.
This commit is contained in:
Eric Schweitz 2024-06-10 11:28:44 -07:00 committed by GitHub
parent c5978f1eb5
commit 7326aa7a0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,8 +21,6 @@
using namespace llvm;
static sys::SmartMutex<true> OutputMutex;
CodeGenCoverage::CodeGenCoverage() = default;
void CodeGenCoverage::setCovered(uint64_t RuleID) {
@ -79,6 +77,7 @@ bool CodeGenCoverage::parse(MemoryBuffer &Buffer, StringRef BackendName) {
bool CodeGenCoverage::emit(StringRef CoveragePrefix,
StringRef BackendName) const {
if (!CoveragePrefix.empty() && !RuleCoverage.empty()) {
static sys::SmartMutex<true> OutputMutex;
sys::SmartScopedLock<true> Lock(OutputMutex);
// We can handle locking within a process easily enough but we don't want to