[SafeStack][DebugInfo] Insert DW_OP_deref in correct location
authorLeonard Chan <leonardchan@google.com>
Tue, 28 Jan 2020 20:30:33 +0000 (12:30 -0800)
committerLeonard Chan <leonardchan@google.com>
Thu, 30 Jan 2020 23:58:37 +0000 (15:58 -0800)
commitfff6a1b0f1fe57b46379001db75952d2a06eab1f
tree15453ca95eae440c4eabfa365c59d7bc0f03a48e
parent457a6d49d565075ae99f0e5a931bbed6512dce2f
[SafeStack][DebugInfo] Insert DW_OP_deref in correct location

This patch addresses the issue found in https://bugs.llvm.org/show_bug.cgi?id=44585
where a DW_OP_deref was placed at the end of a dwarf expression, resulting in
corrupt symbols when debugging.

Differential Revision: https://reviews.llvm.org/D73526
llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
llvm/test/DebugInfo/COFF/types-array-advanced.ll
llvm/test/DebugInfo/X86/safestack-byval.ll
llvm/test/DebugInfo/X86/safestack-deref.ll [new file with mode: 0644]