Fix a bug that prevents global variables from having a DW_OP_deref.
authorAdrian Prantl <aprantl@apple.com>
Thu, 26 Apr 2018 18:17:04 +0000 (18:17 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 26 Apr 2018 18:17:04 +0000 (18:17 +0000)
commite42805d07c4540826bebebb532fb31d6dc97020f
treed06842c92b6ed68d8732bad3dfb0e22d62701f3b
parent6bb5a41f99445a9c067a699028d0d62a89953d12
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

llvm-svn: 330970
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/test/DebugInfo/X86/global-expression.ll [new file with mode: 0644]