diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-15 23:32:02 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-16 00:09:00 -0700 |
| commit | c3663f2617fd317f458bfa013ea94efb7dbcfee5 (patch) | |
| tree | 21f88c80bd8279909a3f65abd3bc01c87eb3ca0d /src/codegen/llvm | |
| parent | cfc31b5bbdf67632626eb934886cdeaefe40e595 (diff) | |
| download | zig-c3663f2617fd317f458bfa013ea94efb7dbcfee5.tar.gz zig-c3663f2617fd317f458bfa013ea94efb7dbcfee5.zip | |
LLVM: implement debug info for structs
This involved some significant reworking in order to introduce the
concept of "forward declarations" to the system to break dependency
loops.
The `lowerDebugType` function now takes an `enum { full, fwd }` and is moved
from `DeclGen` to `Object` so that it can be called from `flushModule`.
`DITypeMap` is now an `ArrayHashMap` instead of a `HashMap` so that we can
iterate over the entries in `flushModule` and finalize the forward decl
DITypes into full DITypes.
`DITypeMap` now stores `AnnotatedDITypePtr` values instead of
`*DIType` values. This is an abstraction around a `usize` which assumes
the pointers will be at least 2 bytes aligned and uses the least
significant bit to store whether it is forward decl or a fully resolved
debug info type.
`lowerDebugTypeImpl` is extracted out from `lowerDebugType` and it has a
mechanism for completing a forward decl DIType to a fully resolved one.
The function now contains lowering for struct types. Closes #11095.
There is a workaround for struct types which have not had
`resolveFieldTypes` called in Sema, even by the time `flushModule` is
called. This is a deficiency of Sema that should be addressed, and the
workaround removed. I think Sema needs a new mechanism to queue up type
resolution work instead of doing it in-line, so that it does not cause
false dependency loops. We already have one failing behavior test
because of a false dependency loop.
Diffstat (limited to 'src/codegen/llvm')
0 files changed, 0 insertions, 0 deletions
