You've already forked llvm-project
mirror of
https://github.com/AdaCore/llvm-project.git
synced 2026-02-12 13:52:35 -08:00
In Ada, it is possible for a type to refer to the value of local
variables. In many cases this can be described in the DWARF using
existing LLVM constructs. However, in some cases, a DWARF expression
that uses multiple variables can be required.
This patch adds a mechanism to allow this. It adds a new
DIVariableExpression class. This class holds a DIExpression and a
list of variables. When DWARF is emitted, each DW_OP_LLVM_arg in the
expression is changed to a DW_OP_GNU_variable_value referencing the
variable's DIE.
DW_OP_GNU_variable_value has been in use in GCC for years. This has
also been proposed for DWARF 6, though unfortunately it seems to have
stalled:
http://dwarfstd.org/ShowIssue.php?issue=161109.2
At present this feature is only supported for member offsets and
sizes, and the size of a DICompositeType. These are just the spots
that I know are needed by gnat-llvm.