Debug Info: Fix LTO type uniquing for C++ member declarations
[opencl/llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index 4b2b7b01f172ed6b300f8fa72de6d1e82a4eb6ad..a03da3c452a66467439e6a93d408a8594f794bc6 100644 (file)
@@ -364,6 +364,7 @@ bool DwarfDebug::isSubprogramContext(const MDNode *Context) {
 // scope then create and insert DIEs for these variables.
 DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU,
                                           DISubprogram SP) {
+  SP = SPCU->getOdrUniqueSubprogram(resolve(SP.getContext()), SP);
   DIE *SPDie = SPCU->getDIE(SP);
 
   assert(SPDie && "Unable to find subprogram DIE!");