From: Devang Patel Date: Mon, 5 Oct 2009 23:59:00 +0000 (+0000) Subject: If subprogram die is not available then construct new one. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ffd9c3dd4a0f9b5c341b27862540c1ed165b22a7;p=oota-llvm.git If subprogram die is not available then construct new one. This can happen if debug info is processed lazily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83347 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2aff2f2593b..b80d2e75aad 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1464,6 +1464,10 @@ void DwarfDebug::ConstructFunctionDbgScope(DbgScope *RootScope, // Get the subprogram die. DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getNode()); + if (!SPDie) { + ConstructSubprogram(SPD.getNode()); + SPDie = ModuleCU->getDieMapSlotFor(SPD.getNode()); + } assert(SPDie && "Missing subprogram descriptor"); if (!AbstractScope) {