<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 19, 2016 at 3:42 PM, Adrian Prantl via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: adrian<br>
Date: Tue Jan 19 17:42:53 2016<br>
New Revision: 258251<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=258251&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=258251&view=rev</a><br>
Log:<br>
Module Debugging: Don't emit external type references to anonymous types.<br>
Even if they exist in the module, they can't be matched with the forward<br>
declaration in the object file.<br></blockquote><div><br></div><div>They can't be matched because they're matched by (non-mangled) name? I thought at least they'd be matched by mangled name (& perhaps we need to emit DW_AT_linkage_name on them to make that possible)?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<rdar://problem/24199640><br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
    cfe/trunk/test/Modules/ExtDebugInfo.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=258251&r1=258250&r2=258251&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=258251&r1=258250&r2=258251&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Jan 19 17:42:53 2016<br>
@@ -1536,8 +1536,9 @@ static bool shouldOmitDefinition(CodeGen<br>
                                  const RecordDecl *RD,<br>
                                  const LangOptions &LangOpts) {<br>
   // Does the type exist in an imported clang module?<br>
-  if (DebugTypeExtRefs && RD->isFromASTFile() && RD->getDefinition())<br>
-      return true;<br>
+  if (DebugTypeExtRefs && RD->isFromASTFile() && RD->getDefinition() &&<br>
+      RD->isExternallyVisible())<br></blockquote><div><br></div><div>Not sure if this is the right check. There might be named things that are static (so not externally visible) in headers?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+    return true;<br>
<br>
   if (DebugKind > CodeGenOptions::LimitedDebugInfo)<br>
     return false;<br>
<br>
Modified: cfe/trunk/test/Modules/ExtDebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ExtDebugInfo.cpp?rev=258251&r1=258250&r2=258251&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ExtDebugInfo.cpp?rev=258251&r1=258250&r2=258251&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Modules/ExtDebugInfo.cpp (original)<br>
+++ cfe/trunk/test/Modules/ExtDebugInfo.cpp Tue Jan 19 17:42:53 2016<br>
@@ -84,4 +84,13 @@ void foo() {<br>
 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, scope: ![[NS]],<br>
 // CHECK-SAME:             line: 16<br>
<br>
+// CHECK: !DIGlobalVariable(name: "GlobalUnion",<br>
+// CHECK-SAME:              type: ![[GLOBAL_UNION:[0-9]+]]<br>
+// CHECK: ![[GLOBAL_UNION]] = !DICompositeType(tag: DW_TAG_union_type,<br>
+// CHECK-SAME:                elements: !{{[0-9]+}})<br>
+// CHECK: !DIGlobalVariable(name: "GlobalStruct",<br>
+// CHECK-SAME:              type: ![[GLOBAL_STRUCT:[0-9]+]]<br>
+// CHECK: ![[GLOBAL_STRUCT]] = !DICompositeType(tag: DW_TAG_structure_type,<br>
+// CHECK-SAME:                elements: !{{[0-9]+}})<br>
+<br>
 // CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !"_ZTSN8DebugCXX6StructE", line: 24)<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>