ManagedStatic: remove from PerfJITEventListener

This change originally landed as part of
e6f1f06245 (D129120), which caused a
Fuchsia buildbot regression in ExecutionEngine tests.

I am resubmitting the backed out parts in smaller pieces after a careful
review.
This commit is contained in:
Nicolai Hähnle 2022-07-10 10:19:27 +02:00
parent 60cbf3fade
commit 4f7298cd79
1 changed files with 4 additions and 6 deletions

View File

@ -24,7 +24,6 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/Path.h"
@ -488,15 +487,14 @@ void PerfJITEventListener::NotifyDebug(uint64_t CodeAddr,
}
}
// There should be only a single event listener per process, otherwise perf gets
// confused.
llvm::ManagedStatic<PerfJITEventListener> PerfListener;
} // end anonymous namespace
namespace llvm {
JITEventListener *JITEventListener::createPerfJITEventListener() {
return &*PerfListener;
// There should be only a single event listener per process, otherwise perf
// gets confused.
static PerfJITEventListener PerfListener;
return &PerfListener;
}
} // namespace llvm