diff options
| author | Markus Lavin <markus.lavin@ericsson.com> | 2019-03-19 08:48:19 +0000 |
|---|---|---|
| committer | Markus Lavin <markus.lavin@ericsson.com> | 2019-03-19 08:48:19 +0000 |
| commit | cd8a940b37b284bf827665c10bcb4351b6d2e1c6 (patch) | |
| tree | c5b934ca4249bc75add749efbe477c94a5450713 /llvm/lib/DebugInfo | |
| parent | f170dff3c198290eda05272f7d4beb6f93b80168 (diff) | |
| download | bcm5719-llvm-cd8a940b37b284bf827665c10bcb4351b6d2e1c6.tar.gz bcm5719-llvm-cd8a940b37b284bf827665c10bcb4351b6d2e1c6.zip | |
[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
Diffstat (limited to 'llvm/lib/DebugInfo')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index 366b4df6657..6bac12f765d 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -225,6 +225,7 @@ void DWARFDebugLoclists::LocationList::dump(raw_ostream &OS, uint64_t BaseAddr, bool IsLittleEndian, unsigned AddressSize, const MCRegisterInfo *MRI, + DWARFUnit *U, unsigned Indent) const { for (const Entry &E : Entries) { switch (E.Kind) { @@ -254,7 +255,7 @@ void DWARFDebugLoclists::LocationList::dump(raw_ostream &OS, uint64_t BaseAddr, llvm_unreachable("unreachable locations list kind"); } - dumpExpression(OS, E.Loc, IsLittleEndian, AddressSize, MRI, nullptr); + dumpExpression(OS, E.Loc, IsLittleEndian, AddressSize, MRI, U); } } @@ -263,7 +264,7 @@ void DWARFDebugLoclists::dump(raw_ostream &OS, uint64_t BaseAddr, Optional<uint64_t> Offset) const { auto DumpLocationList = [&](const LocationList &L) { OS << format("0x%8.8x: ", L.Offset); - L.dump(OS, BaseAddr, IsLittleEndian, AddressSize, MRI, /*Indent=*/12); + L.dump(OS, BaseAddr, IsLittleEndian, AddressSize, MRI, nullptr, /*Indent=*/12); OS << "\n\n"; }; diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index 4cd69bc8017..4a837cd3526 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -130,7 +130,7 @@ static void dumpLocation(raw_ostream &OS, DWARFFormValue &FormValue, if (LL) LL->dump(OS, BaseAddr, Ctx.isLittleEndian(), Obj.getAddressSize(), MRI, - Indent); + U, Indent); else OS << "error extracting location list."; } diff --git a/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp b/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp index 24400ff89c6..133b85a0969 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp @@ -188,6 +188,8 @@ bool DWARFExpression::Operation::extract(DataExtractor Data, uint16_t Version, default: llvm_unreachable("Unknown DWARFExpression Op size"); } + + OperandEndOffsets[Operand] = Offset; } EndOffset = Offset; |

