forked from OSchip/llvm-project
Frontend/XML: Add support for printing nested structures, patch by Martin Vejnár!
llvm-svn: 115041
This commit is contained in:
parent
a9dd1998cc
commit
37614d875f
|
@ -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) {
|
||||
|
|
|
@ -188,3 +188,11 @@ void f10() {
|
|||
|
||||
x = (struct f10_s0) { .iv0 = "name" };
|
||||
}
|
||||
|
||||
// Nested structures.
|
||||
struct s11 {
|
||||
struct s11_2 {
|
||||
int f0;
|
||||
} f0;
|
||||
int f1;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue