aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_debug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/llvm_backend_debug.cpp')
-rw-r--r--src/llvm_backend_debug.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/llvm_backend_debug.cpp b/src/llvm_backend_debug.cpp
index 83f6da04e..fc9e63274 100644
--- a/src/llvm_backend_debug.cpp
+++ b/src/llvm_backend_debug.cpp
@@ -495,15 +495,14 @@ 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) {
return found;
}
+ MUTEX_GUARD(&m->debug_values_mutex);
+
if (type->kind == Type_Named) {
LLVMMetadataRef file = nullptr;
unsigned line = 0;