diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-05 15:56:45 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-05 15:56:45 +0000 |
| commit | 5eee8077ddea82610bf72a37c4032bb06b1c4ab0 (patch) | |
| tree | 8f7be5bc063d8410f27e4be67c20aadc6c32fcd5 /src/llvm_backend_debug.cpp | |
| parent | 029cb6581b483f7db5b6bf35241b4b8a5cc544ff (diff) | |
enum-ifiy function pass managers for `lbModule`
Diffstat (limited to 'src/llvm_backend_debug.cpp')
| -rw-r--r-- | src/llvm_backend_debug.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/llvm_backend_debug.cpp b/src/llvm_backend_debug.cpp index 55c4370a2..9bf4063d6 100644 --- a/src/llvm_backend_debug.cpp +++ b/src/llvm_backend_debug.cpp @@ -2,7 +2,9 @@ gb_internal LLVMMetadataRef lb_get_llvm_metadata(lbModule *m, void *key) { if (key == nullptr) { return nullptr; } + mutex_lock(&m->debug_values_mutex); auto found = map_get(&m->debug_values, key); + mutex_unlock(&m->debug_values_mutex); if (found) { return *found; } @@ -10,7 +12,9 @@ gb_internal LLVMMetadataRef lb_get_llvm_metadata(lbModule *m, void *key) { } gb_internal void lb_set_llvm_metadata(lbModule *m, void *key, LLVMMetadataRef value) { if (key != nullptr) { + mutex_lock(&m->debug_values_mutex); map_set(&m->debug_values, key, value); + mutex_unlock(&m->debug_values_mutex); } } @@ -491,6 +495,9 @@ gb_internal LLVMMetadataRef lb_get_base_scope_metadata(lbModule *m, Scope *scope } gb_internal LLVMMetadataRef lb_debug_type(lbModule *m, Type *type) { + mutex_lock(&m->debug_values_mutex); + defer (mutex_unlock(&m->debug_values_mutex)); + GB_ASSERT(type != nullptr); LLVMMetadataRef found = lb_get_llvm_metadata(m, type); if (found != nullptr) { |