Extend debug info for function parameters in SDAG.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 1 Dec 2015 00:34:30 +0000 (00:34 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 1 Dec 2015 00:34:30 +0000 (00:34 +0000)
commit390ced11080a9faa958b4b6e08e8d7fd40347ac2
tree2a7191bb9f9c8f79b8d6d9122436a4d2b534ab5b
parent531c21057053b9dd7d77ef59ddd92a1d99f0e1bc
Extend debug info for function parameters in SDAG.

SDAG currently can emit debug location for function parameters when
an llvm.dbg.declare points to either a function argument SSA temp,
or to an AllocaInst. This change extends this logic by adding a
fallback case when neither of the above is true.

This is required for SafeStack, which may copy the contents of a
byval function argument into something that is not an alloca, and
then describe the target as the new location of the said argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254352 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/DebugInfo/Generic/safestack-byval.ll [new file with mode: 0644]