aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-04-01 00:29:57 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2024-04-01 16:28:44 +0200
commit9647cb74ad7f72b25a1cd513a153871dc00b036d (patch)
tree985d772652b56f13e7a2fd559b969094ab42ee59 /src/llvm_backend.cpp
parent0d8dadb0840ced094383193b7fc22dd86d41e403 (diff)
debug info fixes/refactor
This fixes (on my end) #3340, #3117, #2945, #2922, and #2762 A general refactor of debug info generation in order to fix issues and increase stability. What I believe is the root cause of a bunch of issues is that we use the temporary metadata/forward declarations too much (/ hold onto them for too long). It seems to cause problems with the reference counting inside LLVM. This PR reduces the use of these forward declarations to a minimum, it creates it, fills in the fields, and resolves it, instead of waiting until the end of generating code. Some smaller issues I came across have also been solved.
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index cc9b3ac5d..645a091b0 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -1978,12 +1978,6 @@ gb_internal void lb_debug_info_complete_types_and_finalize(lbGenerator *gen) {
for (auto const &entry : gen->modules) {
lbModule *m = entry.value;
if (m->debug_builder != nullptr) {
- lb_debug_complete_types(m);
- }
- }
- for (auto const &entry : gen->modules) {
- lbModule *m = entry.value;
- if (m->debug_builder != nullptr) {
LLVMDIBuilderFinalize(m->debug_builder);
}
}