Skip to content

Instantly share code, notes, and snippets.

@PlloYNiiE
Created February 1, 2011 02:49
Show Gist options
  • Select an option

  • Save PlloYNiiE/805320 to your computer and use it in GitHub Desktop.

Select an option

Save PlloYNiiE/805320 to your computer and use it in GitHub Desktop.
DeclContext *DC = vd->getDeclContext();
for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end();
D != DEnd; ++D) {
QualType CurDeclType = getDeclType(*D);
std::cout << "xxx"<<CurDeclType->getTypeClassName()<<"yy"<<std::endl;
if (!Decls.empty() && !CurDeclType.isNull()) {
QualType BaseType = GetBaseType(CurDeclType);
if (!BaseType.isNull() && isa<TagType>(BaseType) &&
cast<TagType>(BaseType)->getDecl() == Decls[0]) {
//D->dump();
Decls.push_back(*D);
continue;
}
}
// If we have a merged group waiting to be handled, handle it now.
if (!Decls.empty())
ProcessDeclGroup(Decls);
// If the current declaration is an unnamed tag type, save it
// so we can merge it with the subsequent declaration(s) using it.
if (isa<TagDecl>(*D) && !cast<TagDecl>(*D)->getIdentifier()) {
Decls.push_back(*D);
continue;
}
/* if (isa<AccessSpecDecl>(*D)) {
Indentation -= Policy.Indentation;
this->Indent();
Print(D->getAccess());
Out << ":\n";
Indentation += Policy.Indentation;
continue;
}*/
}
//clang::TypeDecl *td = dyn_cast<clang::TypeDecl>(vd->getDeclName());
//std::cout << td->dump() << std::endl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment