[cfe-commits] r115041 - in /cfe/trunk: lib/Frontend/DeclXML.cpp test/Coverage/c-language-features.inc

Daniel Dunbar daniel at zuster.org
Wed Sep 29 09:09:28 PDT 2010


Author: ddunbar
Date: Wed Sep 29 11:09:28 2010
New Revision: 115041

URL: http://llvm.org/viewvc/llvm-project?rev=115041&view=rev
Log:
Frontend/XML: Add support for printing nested structures, patch by Martin Vejnár!

Modified:
    cfe/trunk/lib/Frontend/DeclXML.cpp
    cfe/trunk/test/Coverage/c-language-features.inc

Modified: cfe/trunk/lib/Frontend/DeclXML.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/DeclXML.cpp?rev=115041&r1=115040&r2=115041&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/DeclXML.cpp (original)
+++ cfe/trunk/lib/Frontend/DeclXML.cpp Wed Sep 29 11:09:28 2010
@@ -43,6 +43,18 @@
       Visit(*i);
       Doc.toParent();
     }
+
+    for (RecordDecl::decl_iterator i = RD->decls_begin(),
+                                   e = RD->decls_end(); i != e; ++i) {
+      Decl *d = *i;
+      if (isa<RecordDecl>(d)) {
+        RecordDecl* pRec = cast<RecordDecl>(d);
+        if (pRec->isDefinition()) {
+          Visit(pRec);
+          Doc.toParent();
+        }
+      }
+    }
   }
 
   void addSubNodes(CXXRecordDecl* RD) {

Modified: cfe/trunk/test/Coverage/c-language-features.inc
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/c-language-features.inc?rev=115041&r1=115040&r2=115041&view=diff
==============================================================================
--- cfe/trunk/test/Coverage/c-language-features.inc (original)
+++ cfe/trunk/test/Coverage/c-language-features.inc Wed Sep 29 11:09:28 2010
@@ -188,3 +188,11 @@
 
   x = (struct f10_s0) { .iv0 = "name" };
 }
+
+// Nested structures.
+struct s11 {
+  struct s11_2 {
+    int f0;
+  } f0;
+  int f1;
+};





More information about the cfe-commits mailing list