This is an archive of the discontinued LLVM Phabricator instance.

Align definition of DW_OP_plus with DWARF spec [2/3]
ClosedPublic

Authored by sdesmalen on Jun 5 2017, 6:44 AM.

Details

Summary

This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things.
 
The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack.
 
This is done in three stages:
• The first patch (LLVM) adds support for DW_OP_plus_uconst and changes all uses (and tests) of DW_OP_plus to use DW_OP_plus_uconst.
 
• The second patch (Clang) contains changes to use DW_OP_plus_uconst instead of DW_OP_plus.
 
• The third patch (LLVM) changes the semantics of DW_OP_plus to be in line with it’s DWARF meaning. It also does this for DW_OP_minus.

Patch by Sander de Smalen.

Diff Detail

Event Timeline

sdesmalen created this revision.Jun 5 2017, 6:44 AM
aprantl accepted this revision.Jun 5 2017, 8:49 AM

Thanks, this LGTM!

This revision is now accepted and ready to land.Jun 5 2017, 8:49 AM
fhahn edited the summary of this revision. (Show Details)Jun 13 2017, 11:03 AM
fhahn closed this revision.Jun 13 2017, 11:06 AM