From b86ce219f4dabe1ac5ceee79651b05308672064e Mon Sep 17 00:00:00 2001 From: Markus Lavin Date: Tue, 19 Mar 2019 13:16:28 +0000 Subject: [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. This is a recommit of r356442 with trivial fixes for the failing tests. Differential Revision: https://reviews.llvm.org/D56587 llvm-svn: 356451 --- llvm/lib/BinaryFormat/Dwarf.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/BinaryFormat/Dwarf.cpp') diff --git a/llvm/lib/BinaryFormat/Dwarf.cpp b/llvm/lib/BinaryFormat/Dwarf.cpp index 73f04a3ed28..b6d4d5b0730 100644 --- a/llvm/lib/BinaryFormat/Dwarf.cpp +++ b/llvm/lib/BinaryFormat/Dwarf.cpp @@ -143,6 +143,8 @@ StringRef llvm::dwarf::OperationEncodingString(unsigned Encoding) { case DW_OP_##NAME: \ return "DW_OP_" #NAME; #include "llvm/BinaryFormat/Dwarf.def" + case DW_OP_LLVM_convert: + return "DW_OP_LLVM_convert"; case DW_OP_LLVM_fragment: return "DW_OP_LLVM_fragment"; } @@ -153,6 +155,7 @@ unsigned llvm::dwarf::getOperationEncoding(StringRef OperationEncodingString) { #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \ .Case("DW_OP_" #NAME, DW_OP_##NAME) #include "llvm/BinaryFormat/Dwarf.def" + .Case("DW_OP_LLVM_convert", DW_OP_LLVM_convert) .Case("DW_OP_LLVM_fragment", DW_OP_LLVM_fragment) .Default(0); } -- cgit v1.2.3