[DebugInfo] Introduce DW_OP_LLVM_convert
authorMarkus Lavin <markus.lavin@ericsson.com>
Tue, 19 Mar 2019 08:48:19 +0000 (08:48 +0000)
committerMarkus Lavin <markus.lavin@ericsson.com>
Tue, 19 Mar 2019 08:48:19 +0000 (08:48 +0000)
commitcd8a940b37b284bf827665c10bcb4351b6d2e1c6
treec5b934ca4249bc75add749efbe477c94a5450713
parentf170dff3c198290eda05272f7d4beb6f93b80168
[DebugInfo] Introduce DW_OP_LLVM_convert

Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
for a convenient way to perform type conversions on the Dwarf expression
stack. As an additional bonus it paves the way for using other Dwarf
v5 ops that need to reference a base_type.

The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
to perform sext/zext on debug values but mainly the patch is about
preparing terrain for adding other Dwarf v5 ops that need to reference a
base_type.

For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
complex shift & mask pattern is generated to emulate sext/zext.

Differential Revision: https://reviews.llvm.org/D56587

llvm-svn: 356442
37 files changed:
llvm/docs/LangRef.rst
llvm/include/llvm/BinaryFormat/Dwarf.h
llvm/include/llvm/CodeGen/AsmPrinter.h
llvm/include/llvm/CodeGen/DIE.h
llvm/include/llvm/CodeGen/DIEValue.def
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
llvm/include/llvm/MC/MCStreamer.h
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/BinaryFormat/Dwarf.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
llvm/lib/CodeGen/AsmPrinter/ByteStreamer.h
llvm/lib/CodeGen/AsmPrinter/DIE.cpp
llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp
llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
llvm/lib/CodeGen/AsmPrinter/DwarfFile.h
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt
llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/lib/MC/MCStreamer.cpp
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Assembler/diexpression.ll
llvm/test/DebugInfo/Generic/convert-debugloc.ll [new file with mode: 0644]
llvm/test/DebugInfo/Generic/convert-inlined.ll [new file with mode: 0644]
llvm/test/DebugInfo/Generic/convert-linked.ll [new file with mode: 0644]
llvm/test/Transforms/InstCombine/cast-set-preserve-signed-dbg-val.ll
llvm/unittests/Transforms/Utils/LocalTest.cpp