Out << D->getNameAsString();
}
Out << ";\n";
+ } else if (EnumDecl *ED = dyn_cast<EnumDecl>(D)) {
+ Out << "enum " << ED->getNameAsString() << " {\n";
+ for (EnumDecl::enumerator_iterator E = ED->enumerator_begin(),
+ EEnd = ED->enumerator_end();
+ E != EEnd; ++E)
+ Out << " " << (*E)->getNameAsString() << ",\n";
+ Out << "};\n";
} else if (TagDecl *TD = dyn_cast<TagDecl>(D)) {
Out << "Read top-level tag decl: '" << TD->getNameAsString() << "'\n";
} else if (ScopedDecl *SD = dyn_cast<ScopedDecl>(D)) {
// Register this decl in the current scope stack.
PushOnScopeChains(New, S);
+
+ // Add this enumerator into the enum itself.
+ // FIXME: This means that the enumerator is stored in two
+ // DeclContexts. This is not a long-term solution.
+ New->setLexicalDeclContext(TheEnumDecl);
+ TheEnumDecl->addDecl(Context, New, true);
return New;
}