Correctly handle complex locations expressions in replaceDbgDeclareForAlloca()
authorFrederic Riss <friss@apple.com>
Tue, 9 Dec 2014 17:55:48 +0000 (17:55 +0000)
committerFrederic Riss <friss@apple.com>
Tue, 9 Dec 2014 17:55:48 +0000 (17:55 +0000)
commit7c78db5065a34dd91b294fc68ad1b1ea0df13cba
tree0bcc804b94df2187058559167ba232df9ca2c7bb
parent3a4095de83f34df1f283af5af7abd200c8655c1c
Correctly handle complex locations expressions in replaceDbgDeclareForAlloca()

replaceDbgDeclareForAlloca() replaces an alloca by a value storing the
address of what was the alloca. If there is a dbg.declare corresponding
to that alloca, we need to lower it to a dbg.value describing the additional
dereference operation to be performed to get to the underlying variable.
 This is done by adding a DW_OP_deref to the complex location part of the
location description. This deref was added to the end of the operation list,
which is wrong. The expression applies to what is described by the
dbg.{declare,value}, and as we are changing this, we need to apply the
DW_OP_deref as the first operation in the list.

Part of the fix for rdar://19162268.

llvm-svn: 223799
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/DebugInfo/block-asan.ll [new file with mode: 0644]