summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-03-14 23:08:25 +0000
committerAdrian Prantl <aprantl@apple.com>2014-03-14 23:08:25 +0000
commitd1e6a4e1895e322a6a630349b32f7fb22467a94f (patch)
tree7eab520f7d5e4c5380cffc9c0f7d6dd3eff0ae01 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
parent5a4b90deaebfb3e35ad29b410109a1f736bad56f (diff)
downloadbcm5719-llvm-d1e6a4e1895e322a6a630349b32f7fb22467a94f.tar.gz
bcm5719-llvm-d1e6a4e1895e322a6a630349b32f7fb22467a94f.zip
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. llvm-svn: 203982
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index bd1d304b71d..baf87323178 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -353,6 +353,9 @@ class DwarfDebug : public AsmPrinterHandler {
/// of in DwarfCompileUnit.
DenseMap<const MDNode *, DIE *> MDTypeNodeToDieMap;
+ // Used to unique C++ member function declarations.
+ StringMap<const MDNode *> OdrMemberMap;
+
// Stores the current file ID for a given compile unit.
DenseMap<unsigned, unsigned> FileIDCUMap;
// Source id map, i.e. CUID, source filename and directory,
@@ -702,6 +705,11 @@ public:
return MDTypeNodeToDieMap.lookup(TypeMD);
}
+ /// \brief Look up or create an entry in the OdrMemberMap.
+ const MDNode *&getOrCreateOdrMember(StringRef Key) {
+ return OdrMemberMap.GetOrCreateValue(Key).getValue();
+ }
+
/// \brief Emit all Dwarf sections that should come prior to the
/// content.
void beginModule();
OpenPOWER on IntegriCloud