[DebugInfo] Apply subprogram attributes on behalf of owner CU
authorEugene Leviant <eleviant@accesssoftek.com>
Wed, 27 Feb 2019 14:46:59 +0000 (14:46 +0000)
committerEugene Leviant <eleviant@accesssoftek.com>
Wed, 27 Feb 2019 14:46:59 +0000 (14:46 +0000)
commit7f78d4712f91d034e1850d0a0030a090fbe14999
tree59f72eb90152750f4ce66eef406d82092550f62f
parentd73a67a799a116857b4e316814c6e8ee5c7b13a6
[DebugInfo] Apply subprogram attributes on behalf of owner CU

When using full LTO it is possible that template function definition DIE
is bound to one compilation unit and it's declaration to another. We should
add function declaration attributes on behalf of its owner CU otherwise
we may end up with malformed file identifier in function declaration
DW_AT_decl_file attribute.

Differential revision: https://reviews.llvm.org/D58538

llvm-svn: 354978
llvm/include/llvm/CodeGen/DIE.h
llvm/lib/CodeGen/AsmPrinter/DIE.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/test/DebugInfo/X86/template_function_decl.ll [new file with mode: 0644]