Debug Info: Fix LTO type uniquing for C++ member declarations
authorAdrian Prantl <aprantl@apple.com>
Fri, 14 Mar 2014 23:08:25 +0000 (23:08 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 14 Mar 2014 23:08:25 +0000 (23:08 +0000)
commit7e1a3830ca5838f346534a031c1138afc8793e20
tree1bce249f699f07d22f44d3c8de6654b507ba554c
parent2110a0d07b637b372f16d4af4d3b89bd39dab3b7
Debug Info: Fix LTO type uniquing for C++ member declarations
based on the ODR.

This adds an OdrMemberMap to DwarfDebug which is used to unique C++
member function declarations based on the unique identifier of their
containing class and their mangled name.
We can't use the usual DIRef mechanism here because DIScopes are indexed
using their entire MDNode, including decl_file and decl_line, which need
not be unique (see testcase).

Prior to this change multiple redundant member function declarations would
end up in the same uniqued DW_TAG_class_type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203982 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h
test/Linker/type-unique-odr-a.ll [new file with mode: 0644]
test/Linker/type-unique-odr-b.ll [new file with mode: 0644]