[PATCH] D29672: [DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 7 12:23:40 PST 2017
+Adrian (please do include him in changes like this)
Needs test coverage at least. Adrian: any other concerns about adding new
op types?
On Tue, Feb 7, 2017, 12:20 PM Konstantin Zhuravlyov via Phabricator <
reviews at reviews.llvm.org> wrote:
> kzhuravl created this revision.
> Herald added a subscriber: wdng.
>
> https://reviews.llvm.org/D29672
>
> Files:
> docs/LangRef.rst
> lib/CodeGen/AsmPrinter/DwarfExpression.cpp
> lib/IR/DebugInfoMetadata.cpp
>
>
> Index: lib/IR/DebugInfoMetadata.cpp
> ===================================================================
> --- lib/IR/DebugInfoMetadata.cpp
> +++ lib/IR/DebugInfoMetadata.cpp
> @@ -618,6 +618,8 @@
> case dwarf::DW_OP_plus:
> case dwarf::DW_OP_minus:
> case dwarf::DW_OP_deref:
> + case dwarf::DW_OP_swap:
> + case dwarf::DW_OP_xderef:
> break;
> }
> }
> Index: lib/CodeGen/AsmPrinter/DwarfExpression.cpp
> ===================================================================
> --- lib/CodeGen/AsmPrinter/DwarfExpression.cpp
> +++ lib/CodeGen/AsmPrinter/DwarfExpression.cpp
> @@ -273,6 +273,12 @@
> case dwarf::DW_OP_stack_value:
> AddStackValue();
> break;
> + case dwarf::DW_OP_swap:
> + EmitOp(dwarf::DW_OP_swap);
> + break;
> + case dwarf::DW_OP_xderef:
> + EmitOp(dwarf::DW_OP_xderef);
> + break;
> default:
> llvm_unreachable("unhandled opcode found in expression");
> }
> Index: docs/LangRef.rst
> ===================================================================
> --- docs/LangRef.rst
> +++ docs/LangRef.rst
> @@ -4372,13 +4372,18 @@
> - ``DW_OP_plus, 93`` adds ``93`` to the working expression.
> - ``DW_OP_bit_piece, 16, 8`` specifies the offset and size (``16`` and
> ``8``
> here, respectively) of the variable piece from the working expression.
> +- ``DW_OP_swap`` swaps top two stack entries.
> +- ``DW_OP_xderef`` provides extended dereference mechanism. The entry at
> the top
> + of the stack is treated as an address. The second stack entry is
> treated as an
> + address space identifier.
>
> .. code-block:: text
>
> !0 = !DIExpression(DW_OP_deref)
> !1 = !DIExpression(DW_OP_plus, 3)
> !2 = !DIExpression(DW_OP_bit_piece, 3, 7)
> !3 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_bit_piece, 3, 7)
> + !4 = !DIExpression(DW_OP_constu, 2, DW_OP_swap, DW_OP_xderef)
>
> DIObjCProperty
> """"""""""""""
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170207/145c517c/attachment.html>
More information about the llvm-commits
mailing list