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.
This commit is contained in:
Laytan Laats
2024-04-01 16:28:44 +02:00
parent 0d8dadb084
commit 9647cb74ad
4 changed files with 495 additions and 489 deletions
-2
View File
@@ -199,8 +199,6 @@ struct lbModule {
RecursiveMutex debug_values_mutex;
PtrMap<void *, LLVMMetadataRef> debug_values;
Array<lbIncompleteDebugType> debug_incomplete_types;
StringMap<lbAddr> objc_classes;
StringMap<lbAddr> objc_selectors;