[PATCH] D56587: Fix sign/zero extension in Dwarf expressions.
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 14 08:46:13 PST 2019
aprantl added a comment.
In D56587#1355882 <https://reviews.llvm.org/D56587#1355882>, @markus wrote:
> Probably inserting a pseudo op here lowering it at a later stage when it is known if the value will reside in memory would be the right thing to do. Not sure if a DWARF 5 DW_OP_convert would be the easiest option as its argument references another DIE and it seems that would require larger infrastructure changes (but I really don't know anything about this).
Referencing a DIE in DIExpression would need a bit of additional work. DIExpression stores its operands in an array of uint64_t, so in order to support MDNode operands we'd have to add them as actual MDNode operands. For example, `expr_op_iterator` could know which DIExpression operations take MDNode arguments and inject them in the right places. Slightly more complicated would be actually finding a matching DIType in the debug info that we want to point to. If we want to convert to exactly the type of the DIVariable, we can use that type, otherwise we might have to generate new DIBasicTypes on the fly.
Even though this sounds complicated, I still think that it is preferable to encode type conversions as such rather than generating really complicated expressions that happen to have the same effect in the underspecified DWARF 4 stack language.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56587/new/
https://reviews.llvm.org/D56587
More information about the llvm-commits
mailing list