<div dir="ltr">When reverting something, please say why in the commit description.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 6, 2016 at 11:15 AM, Adrian McCarthy 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: amccarth<br>
Date: Wed Jul  6 10:15:38 2016<br>
New Revision: 274633<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=274633&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=274633&view=rev</a><br>
Log:<br>
Revert "Include debug info for nested structs and classes"<br>
<br>
This reverts commit 0af5ee9631c7c167dc40498b415876553e314c95.<br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
    cfe/trunk/lib/CodeGen/CGDebugInfo.h<br>
    cfe/trunk/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp<br>
    cfe/trunk/test/CodeGenCXX/debug-info-indirect-field-decl.cpp<br>
    cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.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=274633&r1=274632&r2=274633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=274633&r1=274632&r2=274633&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Jul  6 10:15:38 2016<br>
@@ -1095,13 +1095,6 @@ void CGDebugInfo::CollectRecordNormalFie<br>
   elements.push_back(FieldType);<br>
 }<br>
<br>
-void CGDebugInfo::CollectRecordNestedRecord(<br>
-    const RecordDecl *RD, SmallVectorImpl<llvm::Metadata *> &elements) {<br>
-  QualType Ty = CGM.getContext().getTypeDeclType(RD);<br>
-  llvm::DIType *nestedType = getOrCreateType(Ty, getOrCreateMainFile());<br>
-  elements.push_back(nestedType);<br>
-}<br>
-<br>
 void CGDebugInfo::CollectRecordFields(<br>
     const RecordDecl *record, llvm::DIFile *tunit,<br>
     SmallVectorImpl<llvm::Metadata *> &elements,<br>
@@ -1138,9 +1131,6 @@ void CGDebugInfo::CollectRecordFields(<br>
<br>
         // Bump field number for next field.<br>
         ++fieldNo;<br>
-      } else if (const auto *nestedRec = dyn_cast<CXXRecordDecl>(I)) {<br>
-        if (!nestedRec->isImplicit() && nestedRec->getDeclContext() == record)<br>
-          CollectRecordNestedRecord(nestedRec, elements);<br>
       }<br>
   }<br>
 }<br>
@@ -3643,8 +3633,8 @@ void CGDebugInfo::EmitUsingDirective(con<br>
   if (CGM.getCodeGenOpts().getDebugInfo() < codegenoptions::LimitedDebugInfo)<br>
     return;<br>
   const NamespaceDecl *NSDecl = UD.getNominatedNamespace();<br>
-  if (!NSDecl->isAnonymousNamespace() ||<br>
-      CGM.getCodeGenOpts().DebugExplicitImport) {<br>
+  if (!NSDecl->isAnonymousNamespace() ||<br>
+      CGM.getCodeGenOpts().DebugExplicitImport) {<br>
     DBuilder.createImportedModule(<br>
         getCurrentContextDescriptor(cast<Decl>(UD.getDeclContext())),<br>
         getOrCreateNameSpace(NSDecl),<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=274633&r1=274632&r2=274633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=274633&r1=274632&r2=274633&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Wed Jul  6 10:15:38 2016<br>
@@ -254,8 +254,6 @@ class CGDebugInfo {<br>
                                 llvm::DIFile *F,<br>
                                 SmallVectorImpl<llvm::Metadata *> &E,<br>
                                 llvm::DIType *RecordTy, const RecordDecl *RD);<br>
-  void CollectRecordNestedRecord(const RecordDecl *RD,<br>
-                                 SmallVectorImpl<llvm::Metadata *> &E);<br>
   void CollectRecordFields(const RecordDecl *Decl, llvm::DIFile *F,<br>
                            SmallVectorImpl<llvm::Metadata *> &E,<br>
                            llvm::DICompositeType *RecordTy);<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp?rev=274633&r1=274632&r2=274633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp?rev=274633&r1=274632&r2=274633&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp Wed Jul  6 10:15:38 2016<br>
@@ -19,6 +19,6 @@ protected:<br>
<br>
 Test t;<br>
<br>
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "data"<br>
 // CHECK: !DIDerivedType(tag: DW_TAG_pointer_type<br>
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "data"<br>
 // CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "data"<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/debug-info-indirect-field-decl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-indirect-field-decl.cpp?rev=274633&r1=274632&r2=274633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-indirect-field-decl.cpp?rev=274633&r1=274632&r2=274633&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-indirect-field-decl.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/debug-info-indirect-field-decl.cpp Wed Jul  6 10:15:38 2016<br>
@@ -8,18 +8,18 @@ template <class T, int T::*ptr> class Fo<br>
 struct Bar {<br>
   int i1;<br>
   // CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int"<br>
-  // CHECK: ![[UNION:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_union_type,{{.*}} identifier: "_ZTSN3BarUt_E")<br>
+  // CHECK: !DIDerivedType(tag: DW_TAG_member, scope:<br>
+  // CHECK-SAME:           line: [[@LINE+4]]<br>
+  // CHECK-SAME:           baseType: ![[UNION:[0-9]+]]<br>
+  // CHECK-SAME:           size: 32, align: 32, offset: 32<br>
+  // CHECK: ![[UNION]] = distinct !DICompositeType(tag: DW_TAG_union_type,{{.*}} identifier: "_ZTSN3BarUt_E")<br>
   union {<br>
     // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "i2",<br>
-    // CHECK-SAME:           line: [[@LINE+9]]<br>
+    // CHECK-SAME:           line: [[@LINE+5]]<br>
     // CHECK-SAME:           baseType: ![[INT]]<br>
     // CHECK-SAME:           size: 32, align: 32<br>
     // CHECK-NOT:            offset:<br>
     // CHECK-SAME:           ){{$}}<br>
-    // CHECK: !DIDerivedType(tag: DW_TAG_member, scope:<br>
-    // CHECK-SAME:           line: [[@LINE-8]]<br>
-    // CHECK-SAME:           baseType: ![[UNION]]<br>
-    // CHECK-SAME:           size: 32, align: 32, offset: 32<br>
     int i2;<br>
   };<br>
 };<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp?rev=274633&r1=274632&r2=274633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp?rev=274633&r1=274632&r2=274633&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/debug-info-ms-abi.cpp Wed Jul  6 10:15:38 2016<br>
@@ -14,9 +14,6 @@ Foo::Nested n;<br>
 // CHECK: ![[Foo:[^ ]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo",<br>
 // CHECK-SAME: identifier: ".?AUFoo@@"<br>
<br>
-// CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested",<br>
-// CHECK-SAME: identifier: ".?AUNested@Foo@@"<br>
-<br>
 // CHECK: !DISubprogram(name: "f",<br>
 // CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0,<br>
 // CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,<br>
@@ -28,3 +25,6 @@ Foo::Nested n;<br>
 // CHECK: !DISubprogram(name: "h",<br>
 // CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 2,<br>
 // CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,<br>
+<br>
+// CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested",<br>
+// CHECK-SAME: identifier: ".?AUNested@Foo@@"<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>