[PATCH] D13038: dsymutil: Resolve forward decls for types defined in clang modules.

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 17:02:39 PDT 2015


aprantl added inline comments.

================
Comment at: tools/dsymutil/DwarfLinker.cpp:1796-1801
@@ +1795,8 @@
+
+  // Prune this DIE if it is either a forward declaration inside a
+  // DW_TAG_module or a DW_TAG_module that contains nothing but
+  // forward declarations.
+  Info.Prune &= (DIE->getTag() == dwarf::DW_TAG_module) ||
+                DIE->getAttributeValueAsUnsignedConstant(
+                    &CU.getOrigUnit(), dwarf::DW_AT_declaration, 0);
+
----------------
friss wrote:
> Wouldn't that logic always prune the TAG_module? or am I reading this wrong?
It will prune all DW_TAG_modules that have no children or whose children were pruned.
But what about imported empty modules? (See below).

================
Comment at: tools/dsymutil/DwarfLinker.cpp:2214-2215
@@ -2176,2 +2213,4 @@
   bool AlreadyKept = MyInfo.Keep;
+  if (MyInfo.Prune && !AlreadyKept)
+    return;
 
----------------
friss wrote:
> I would have expected Prune to override Keep. What is the '&& !AlreadyKept' handling?
It's handling an otherwise pruned (but imported) DW_TAG_module.


http://reviews.llvm.org/D13038





More information about the llvm-commits mailing list