[llvm-dev] DW_OP_implicit_pointer design/implementation in general

Jeremy Morse via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 2 06:37:59 PST 2020

Hi all,

On the topic of intrinsics, right now we have two (dbg.value /
dbg.addr) that respectively describe:
 * The "direct value" (quoting langref) of a variable, and
 * The address of where the current variable value is stored.
Both of which map onto dwarf locations later on. My reasoning for
wanting a new intrinsic is that implicit pointers are neither of these
things: what is being described is an entirely new domain of
information about the variable, i.e. what it points at. To me that's a
major difference from a "direct value", and something to signal at an
early stage to any consumer wishing to interpret debug intrinsics,
rather than having consumers interpret the DIExpression to discover
whether this is actually the variable value or not.

The counter-argument would be that, in reality, dbg.value is used to
represent everything about with variables and their values, any other
debug intrinsic is likely to be dropped by optimisations, and you
usually have to interpret the DIExpression anyway.

IMO, having a new intrinsic would be conceptually neater; that
neatness might not have a lot of practical value though. I'm not
familiar with LLVMs long term compatibility guarantees when it comes
to intrinsics, so maybe it's more trouble than it's worth.


More information about the llvm-dev mailing list