Skip to content

Commit

Permalink
ManagedStatic: Remove from JITLoaderGDB
Browse files Browse the repository at this point in the history
This change originally landed as part of
e6f1f06 (D129120), which caused a
Fuchsia buildbot regression in ExecutionEngine tests.

I am resubmitting the backed out parts in smaller pieces after a careful
review.
  • Loading branch information
nhaehnle committed Jul 10, 2022
1 parent ede6003 commit 60cbf3f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
Expand Up @@ -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>
Expand Down Expand Up @@ -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({
Expand All @@ -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;
Expand Down

0 comments on commit 60cbf3f

Please sign in to comment.