Index: docs/LangRef.rst =================================================================== --- docs/LangRef.rst +++ docs/LangRef.rst @@ -4372,6 +4372,10 @@ - ``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 @@ -4379,6 +4383,7 @@ !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 """""""""""""" 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: 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; } }