From a475da36eb5013143c19074e3edfc8977ed15b2a Mon Sep 17 00:00:00 2001 From: Markus Lavin Date: Tue, 30 Apr 2019 07:58:57 +0000 Subject: [DebugInfo] DW_OP_deref_size in PrologEpilogInserter. The PrologEpilogInserter need to insert a DW_OP_deref_size before prepending a memory location expression to an already implicit expression to avoid having the existing expression act on the memory address instead of the value behind it. The reason for using DW_OP_deref_size and not plain DW_OP_deref is that big-endian targets need to read the right size as simply truncating a larger read would yield the wrong result (LSB bytes are not at the lower address). This re-commit fixes issues reported in the first one. Namely deref was inserted under wrong conditions and additionally the deref_size argument was incorrectly encoded. Differential Revision: https://reviews.llvm.org/D59687 llvm-svn: 359535 --- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index cace8f06992..6b641eafc44 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -64,6 +64,10 @@ void DIEDwarfExpression::emitUnsigned(uint64_t Value) { CU.addUInt(DIE, dwarf::DW_FORM_udata, Value); } +void DIEDwarfExpression::emitData1(uint8_t Value) { + CU.addUInt(DIE, dwarf::DW_FORM_data1, Value); +} + void DIEDwarfExpression::emitBaseTypeRef(uint64_t Idx) { CU.addBaseTypeRef(DIE, Idx); } -- cgit v1.2.3