[llvm-dev] Concatenating DWARF location expressions

Markus Lavin via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 24 06:04:44 PST 2019


Could someone explain to me what the rules are for concatenation of DWARF location expressions?

For example in lib/CodeGen/PrologEpilogInserter.cpp there is a call to DIExpression::prepend to concatenate the stack slot address of a variable to an existing expression. Now the problem here is that the former is a 'Memory location description' while the latter could very well be a 'Implicit location description' (e.g. the sign extension from  lib/Transforms/Utils/Local.cpp) in which case a DW_OP_deref of some sort would be needed in between.

To me it seems that there is no clear way of knowing what to do when concatenating because there is no clear way of knowing the kind of the existing expression (is it Memory, Register or Implicit).

Without having thought too much about it it would seem that having additional meta ops in the expression for the sole purpose of identifying what kind it is would be helpful when concatenating.

I could find similar topics being raised on the list in the past but was not able to find any clear conclusion.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190124/ee1d17c4/attachment.html>

More information about the llvm-dev mailing list