[PATCH] D33892: Align definition of DW_OP_plus with DWARF spec [1/3]

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 06:42:29 PDT 2017


sdesmalen created this revision.
Herald added subscribers: javed.absar, aprantl.

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.


https://reviews.llvm.org/D33892

Files:
  docs/LangRef.rst
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/CodeGen/AsmPrinter/DwarfExpression.cpp
  lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  lib/IR/DebugInfoMetadata.cpp
  lib/IR/Metadata.cpp
  test/Assembler/diexpression.ll
  test/Bitcode/DIExpression-deref.ll
  test/Bitcode/DIExpression-deref.ll.bc
  test/Bitcode/DIGlobalVariableExpression.ll
  test/Bitcode/DIGlobalVariableExpression.ll.bc
  test/CodeGen/ARM/debug-info-blocks.ll
  test/CodeGen/X86/lea-opt-with-debug.mir
  test/DebugInfo/Generic/block-asan.ll
  test/DebugInfo/X86/block-capture.ll
  test/DebugInfo/X86/debug-info-block-captured-self.ll
  test/DebugInfo/X86/debug-info-blocks.ll
  test/DebugInfo/X86/stack-value-dwarf2.ll
  test/DebugInfo/X86/unattached-global.ll
  test/Transforms/GlobalMerge/debug-info.ll
  test/Transforms/InstCombine/debuginfo-dce.ll
  unittests/IR/MetadataTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33892.101395.patch
Type: text/x-patch
Size: 20043 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170605/bd6dab6f/attachment.bin>


More information about the llvm-commits mailing list