Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -732,8 +732,11 @@ DIE *ContextDIE; DwarfCompileUnit *ContextCU = this; - if (includeMinimalInlineScopes()) + if (includeMinimalInlineScopes()) { ContextDIE = &getUnitDie(); + if (auto *SPDecl = SP->getDeclaration()) + getOrCreateSubprogramDIE(SPDecl); + } // Some of this is duplicated from DwarfUnit::getOrCreateSubprogramDIE, with // the important distinction that the debug node is not associated with the // DIE (since the debug node will be associated with the concrete DIE, if