aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_debug.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2022-08-11 16:14:27 +0100
committerGitHub <noreply@github.com>2022-08-11 16:14:27 +0100
commit57b20e634bf7bd9c606ceb3aec425beb4a1d0db8 (patch)
tree8633580c3cc47b360de210dd5faf35b4e9d6a011 /src/llvm_backend_debug.cpp
parent425dec8bb8cc4fe2cf25a008de199d3084ecb510 (diff)
parente285796fc11148c2f461a1d3753d28babd83769e (diff)
Merge branch 'master' into pretty-json-2
Diffstat (limited to 'src/llvm_backend_debug.cpp')
-rw-r--r--src/llvm_backend_debug.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/llvm_backend_debug.cpp b/src/llvm_backend_debug.cpp
index 45a868581..29e074473 100644
--- a/src/llvm_backend_debug.cpp
+++ b/src/llvm_backend_debug.cpp
@@ -43,6 +43,10 @@ LLVMMetadataRef lb_debug_location_from_ast(lbProcedure *p, Ast *node) {
GB_ASSERT(node != nullptr);
return lb_debug_location_from_token_pos(p, ast_token(node).pos);
}
+LLVMMetadataRef lb_debug_end_location_from_ast(lbProcedure *p, Ast *node) {
+ GB_ASSERT(node != nullptr);
+ return lb_debug_location_from_token_pos(p, ast_end_token(node).pos);
+}
LLVMMetadataRef lb_debug_type_internal_proc(lbModule *m, Type *type) {
i64 size = type_size_of(type); // Check size
@@ -969,7 +973,7 @@ void lb_add_debug_local_variable(lbProcedure *p, LLVMValueRef ptr, Type *type, T
);
LLVMValueRef storage = ptr;
- LLVMBasicBlockRef block = p->decl_block->block;
+ LLVMBasicBlockRef block = p->curr_block->block;
LLVMMetadataRef llvm_debug_loc = lb_debug_location_from_token_pos(p, token.pos);
LLVMMetadataRef llvm_expr = LLVMDIBuilderCreateExpression(m->debug_builder, nullptr, 0);
lb_set_llvm_metadata(m, ptr, llvm_expr);