[PATCH] D46137: Fix an assertion of This DIE should've already been constructed when the " "definition DIE was created in " "getOrCreateSubprogramDIE

Yunlian Jiang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 11:00:39 PDT 2018


yunlian created this revision.
yunlian added a reviewer: dblaikie.
Herald added subscribers: llvm-commits, JDevlieghere.

This makes the assertion in PR37255 disappear.


Repository:
  rL LLVM

https://reviews.llvm.org/D46137

Files:
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46137.144162.patch
Type: text/x-patch
Size: 734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180426/3d5fbf4b/attachment.bin>


More information about the llvm-commits mailing list