OSDN Git Service

Fix a bug that prevents global variables from having a DW_OP_deref.
authorAdrian Prantl <aprantl@apple.com>
Fri, 27 Apr 2018 22:05:31 +0000 (22:05 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 27 Apr 2018 22:05:31 +0000 (22:05 +0000)
commite41979a9ceae4785fcd9300b1de3d80416922bcc
treefefa5abd1c0a12bd6d10857fb3826040183fe404
parentd27174158621b24c78ca477142cb5cb73f07489f
Fix a bug that prevents global variables from having a DW_OP_deref.

For local variables the first DW_OP_deref is consumed by turning the
location kind into a memeory location, but that only makes sense for
values that are in a register to begin with, which cannot happen for
global variables that are attached to a symbol.

rdar://problem/39741860

This reapplies r330970 after fixing an uncovered bug in r331086 and
working around the situation caused by it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331090 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfExpression.cpp
lib/CodeGen/AsmPrinter/DwarfExpression.h
test/DebugInfo/X86/global-expression.ll [new file with mode: 0644]