[llvm] 60cbf3f - ManagedStatic: Remove from JITLoaderGDB
Nicolai Hähnle via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 10 02:29:30 PDT 2022
Author: Nicolai Hähnle
Date: 2022-07-10T10:32:29+02:00
New Revision: 60cbf3fade88addadbc0c877cb5990857908ac31
URL: https://github.com/llvm/llvm-project/commit/60cbf3fade88addadbc0c877cb5990857908ac31
DIFF: https://github.com/llvm/llvm-project/commit/60cbf3fade88addadbc0c877cb5990857908ac31.diff
LOG: ManagedStatic: Remove from JITLoaderGDB
This change originally landed as part of
e6f1f062457c928c18a88c612f39d9e168f65a85 (D129120), which caused a
Fuchsia buildbot regression in ExecutionEngine tests.
I am resubmitting the backed out parts in smaller pieces after a careful
review.
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
index ffa2969536e7b..8296b03398a05 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
@@ -11,7 +11,6 @@
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/FormatVariadic.h"
-#include "llvm/Support/ManagedStatic.h"
#include <cstdint>
#include <mutex>
@@ -67,9 +66,6 @@ LLVM_ATTRIBUTE_NOINLINE void __jit_debug_register_code() {
using namespace llvm;
using namespace llvm::orc;
-// Serialize rendezvous with the debugger as well as access to shared data.
-ManagedStatic<std::mutex> JITDebugLock;
-
// Register debug object, return error message or null for success.
static void registerJITLoaderGDBImpl(const char *ObjAddr, size_t Size) {
LLVM_DEBUG({
@@ -85,7 +81,9 @@ static void registerJITLoaderGDBImpl(const char *ObjAddr, size_t Size) {
E->symfile_size = Size;
E->prev_entry = nullptr;
- std::lock_guard<std::mutex> Lock(*JITDebugLock);
+ // Serialize rendezvous with the debugger as well as access to shared data.
+ static std::mutex JITDebugLock;
+ std::lock_guard<std::mutex> Lock(JITDebugLock);
// Insert this entry at the head of the list.
jit_code_entry *NextEntry = __jit_debug_descriptor.first_entry;
More information about the llvm-commits
mailing list