Frontend/XML: Add support for printing nested structures, patch by Martin Vejnár!

llvm-svn: 115041
This commit is contained in:
Daniel Dunbar 2010-09-29 16:09:28 +00:00
parent a9dd1998cc
commit 37614d875f
2 changed files with 20 additions and 0 deletions

View File

@ -43,6 +43,18 @@ class DocumentXML::DeclPrinter : public DeclVisitor<DocumentXML::DeclPrinter> {
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) {

View File

@ -188,3 +188,11 @@ void f10() {
x = (struct f10_s0) { .iv0 = "name" };
}
// Nested structures.
struct s11 {
struct s11_2 {
int f0;
} f0;
int f1;
};