<div dir="ltr">Reverted because multiple buildbots reported failures of clang/test/Modules/ModuleDebugInfo immediately after submission.  The test passes for me locally.  I'm investigating.<div><br></div><div>SVN revision was:  r274629<br><div><br></div><div>I also reverted a clang patch that depended on this one.<br><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 6, 2016 at 8:14 AM, Adrian McCarthy via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-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:14:10 2016<br>
New Revision: 274632<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=274632&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=274632&view=rev</a><br>
Log:<br>
Revert "Emit CodeView type records for nested classes."<br>
<br>
This reverts commit 256b29322c827a2d94da56468c936596f5509032.<br>
<br>
Removed:<br>
    llvm/trunk/test/DebugInfo/COFF/types-nested-class.ll<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=274632&r1=274631&r2=274632&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=274632&r1=274631&r2=274632&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Wed Jul  6 10:14:10 2016<br>
@@ -1414,8 +1414,6 @@ struct llvm::ClassInfo {<br>
   MemberList Members;<br>
   // Direct overloaded methods gathered by name.<br>
   MethodsMap Methods;<br>
-<br>
-  std::vector<const DICompositeType *> NestedClasses;<br>
 };<br>
<br>
 void CodeViewDebug::clear() {<br>
@@ -1468,8 +1466,8 @@ ClassInfo CodeViewDebug::collectClassInf<br>
         // friends in the past, but modern versions do not.<br>
       }<br>
       // FIXME: Get Clang to emit function virtual table here and handle it.<br>
-    } else if (auto *Composite = dyn_cast<DICompositeType>(Element)) {<br>
-      Info.NestedClasses.push_back(Composite);<br>
+      // FIXME: Get clang to emit nested types here and do something with<br>
+      // them.<br>
     }<br>
     // Skip other unrecognized kinds of elements.<br>
   }<br>
@@ -1498,12 +1496,7 @@ TypeIndex CodeViewDebug::lowerCompleteTy<br>
   TypeIndex FieldTI;<br>
   TypeIndex VShapeTI;<br>
   unsigned FieldCount;<br>
-  bool ContainsNestedClass;<br>
-  std::tie(FieldTI, VShapeTI, FieldCount, ContainsNestedClass) =<br>
-      lowerRecordFieldList(Ty);<br>
-<br>
-  if (ContainsNestedClass)<br>
-    CO |= ClassOptions::ContainsNestedClass;<br>
+  std::tie(FieldTI, VShapeTI, FieldCount) = lowerRecordFieldList(Ty);<br>
<br>
   std::string FullName = getFullyQualifiedName(Ty);<br>
<br>
@@ -1539,13 +1532,7 @@ TypeIndex CodeViewDebug::lowerCompleteTy<br>
   ClassOptions CO = getCommonClassOptions(Ty);<br>
   TypeIndex FieldTI;<br>
   unsigned FieldCount;<br>
-  bool ContainsNestedClass;<br>
-  std::tie(FieldTI, std::ignore, FieldCount, ContainsNestedClass) =<br>
-      lowerRecordFieldList(Ty);<br>
-<br>
-  if (ContainsNestedClass)<br>
-    CO |= ClassOptions::ContainsNestedClass;<br>
-<br>
+  std::tie(FieldTI, std::ignore, FieldCount) = lowerRecordFieldList(Ty);<br>
   uint64_t SizeInBytes = Ty->getSizeInBits() / 8;<br>
   std::string FullName = getFullyQualifiedName(Ty);<br>
<br>
@@ -1563,7 +1550,7 @@ TypeIndex CodeViewDebug::lowerCompleteTy<br>
   return UnionTI;<br>
 }<br>
<br>
-std::tuple<TypeIndex, TypeIndex, unsigned, bool><br>
+std::tuple<TypeIndex, TypeIndex, unsigned><br>
 CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {<br>
   // Manually count members. MSVC appears to count everything that generates a<br>
   // field list record. Each individual overload in a method overload group<br>
@@ -1658,17 +1645,8 @@ CodeViewDebug::lowerRecordFieldList(cons<br>
           OverloadedMethodRecord(Methods.size(), MethodList, Name));<br>
     }<br>
   }<br>
-<br>
-  // Create nested classes.<br>
-  for (const DICompositeType *Nested : Info.NestedClasses) {<br>
-    NestedTypeRecord R(getTypeIndex(DITypeRef(Nested)), Nested->getName());<br>
-    Fields.writeNestedType(R);<br>
-    MemberCount++;<br>
-  }<br>
-<br>
   TypeIndex FieldTI = TypeTable.writeFieldList(Fields);<br>
-  return std::make_tuple(FieldTI, TypeIndex(), MemberCount,<br>
-                         !Info.NestedClasses.empty());<br>
+  return std::make_tuple(FieldTI, TypeIndex(), MemberCount);<br>
 }<br>
<br>
 TypeIndex CodeViewDebug::getVBPTypeIndex() {<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h?rev=274632&r1=274631&r2=274632&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h?rev=274632&r1=274631&r2=274632&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h Wed Jul  6 10:14:10 2016<br>
@@ -275,7 +275,7 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDe<br>
   /// Common record member lowering functionality for record types, which are<br>
   /// structs, classes, and unions. Returns the field list index and the member<br>
   /// count.<br>
-  std::tuple<codeview::TypeIndex, codeview::TypeIndex, unsigned, bool><br>
+  std::tuple<codeview::TypeIndex, codeview::TypeIndex, unsigned><br>
   lowerRecordFieldList(const DICompositeType *Ty);<br>
<br>
   /// Inserts {{Node, ClassTy}, TI} into TypeIndices and checks for duplicates.<br>
<br>
Removed: llvm/trunk/test/DebugInfo/COFF/types-nested-class.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-nested-class.ll?rev=274631&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-nested-class.ll?rev=274631&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/COFF/types-nested-class.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/COFF/types-nested-class.ll (removed)<br>
@@ -1,98 +0,0 @@<br>
-; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s<br>
-<br>
-; C++ source to regenerate:<br>
-; $ cat hello.cpp<br>
-; struct A {<br>
-;   struct Nested {};<br>
-; } a;<br>
-; $ clang hello.cpp -S -emit-llvm -g -gcodeview -o t.ll<br>
-<br>
-; CHECK: CodeViewTypes [<br>
-; CHECK:   Section: .debug$T (5)<br>
-; CHECK:   Magic: 0x4<br>
-; CHECK:   Struct (0x1000) {<br>
-; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
-; CHECK:     MemberCount: 0<br>
-; CHECK:     Properties [ (0x280)<br>
-; CHECK:       ForwardReference (0x80)<br>
-; CHECK:       HasUniqueName (0x200)<br>
-; CHECK:     ]<br>
-; CHECK:     FieldList: 0x0<br>
-; CHECK:     DerivedFrom: 0x0<br>
-; CHECK:     VShape: 0x0<br>
-; CHECK:     SizeOf: 0<br>
-; CHECK:     Name: A<br>
-; CHECK:     LinkageName: .?AUA@@<br>
-; CHECK:   }<br>
-; CHECK:   Struct (0x1001) {<br>
-; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
-; CHECK:     MemberCount: 0<br>
-; CHECK:     Properties [ (0x280)<br>
-; CHECK:       ForwardReference (0x80)<br>
-; CHECK:       HasUniqueName (0x200)<br>
-; CHECK:     ]<br>
-; CHECK:     FieldList: 0x0<br>
-; CHECK:     DerivedFrom: 0x0<br>
-; CHECK:     VShape: 0x0<br>
-; CHECK:     SizeOf: 0<br>
-; CHECK:     Name: A::Nested<br>
-; CHECK:     LinkageName: .?AUNested@A@@<br>
-; CHECK:   }<br>
-; CHECK:   FieldList (0x1002) {<br>
-; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)<br>
-; CHECK:     NestedType {<br>
-; CHECK:       Type: A::Nested (0x1001)<br>
-; CHECK:       Name: Nested<br>
-; CHECK:     }<br>
-; CHECK:   }<br>
-; CHECK:   Struct (0x1003) {<br>
-; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
-; CHECK:     MemberCount: 1<br>
-; CHECK:     Properties [ (0x210)<br>
-; CHECK:       ContainsNestedClass (0x10)<br>
-; CHECK:       HasUniqueName (0x200)<br>
-; CHECK:     ]<br>
-; CHECK:     FieldList: <field list> (0x1002)<br>
-; CHECK:     DerivedFrom: 0x0<br>
-; CHECK:     VShape: 0x0<br>
-; CHECK:     SizeOf: 1<br>
-; CHECK:     Name: A<br>
-; CHECK:     LinkageName: .?AUA@@<br>
-; CHECK:   }<br>
-; CHECK:   StringId (0x1004) {<br>
-; CHECK:     TypeLeafKind: LF_STRING_ID (0x1605)<br>
-; CHECK:     Id: 0x0<br>
-; CHECK:     StringData: D:\src\hello\hello.cpp<br>
-; CHECK:   }<br>
-; CHECK:   UdtSourceLine (0x1005) {<br>
-; CHECK:     TypeLeafKind: LF_UDT_SRC_LINE (0x1606)<br>
-; CHECK:     UDT: A (0x1003)<br>
-; CHECK:     SourceFile: D:\src\hello\hello.cpp (0x1004)<br>
-; CHECK:     LineNumber: 1<br>
-; CHECK:   }<br>
-; CHECK: ]<br>
-<br>
-; ModuleID = 'hello.cpp'<br>
-source_filename = "hello.cpp"<br>
-target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"<br>
-target triple = "i686-pc-windows-msvc19.0.23918"<br>
-<br>
-%struct.A = type { i8 }<br>
-<br>
-@"\01?a@@3UA@@A" = global %struct.A zeroinitializer, align 1<br>
-<br>
-!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
-!llvm.module.flags = !{!8, !9}<br>
-!llvm.ident = !{!10}<br>
-<br>
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)<br>
-!1 = !DIFile(filename: "hello.cpp", directory: "D:\5Csrc\5Chello")<br>
-!2 = !{}<br>
-!3 = !{!4}<br>
-!4 = distinct !DIGlobalVariable(name: "a", linkageName: "\01?a@@3UA@@A", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, variable: %struct.A* @"\01?a@@3UA@@A")<br>
-!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !6, identifier: ".?AUA@@")<br>
-!6 = !{!7}<br>
-!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nested", scope: !5, file: !1, line: 2, size: 8, align: 8, flags: DIFlagFwdDecl, identifier: ".?AUNested@A@@")<br>
-!8 = !{i32 2, !"CodeView", i32 1}<br>
-!9 = !{i32 2, !"Debug Info Version", i32 3}<br>
-!10 = !{!"clang version 3.9.0 "}<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>