AST printing for scoped enumerations and enumerations with a fixed underlying type, from Daniel Wallin

llvm-svn: 120576
This commit is contained in:
Douglas Gregor 2010-12-01 16:01:08 +00:00
parent 85df0ccafd
commit ec0e366163
1 changed files with 16 additions and 3 deletions

View File

@ -307,9 +307,22 @@ void DeclPrinter::VisitTypedefDecl(TypedefDecl *D) {
}
void DeclPrinter::VisitEnumDecl(EnumDecl *D) {
Out << "enum " << D << " {\n";
VisitDeclContext(D);
Indent() << "}";
Out << "enum ";
if (D->isScoped())
Out << "class ";
Out << D;
if (D->isFixed()) {
std::string Underlying;
D->getIntegerType().getAsStringInternal(Underlying, Policy);
Out << " : " << Underlying;
}
if (D->isDefinition()) {
Out << " {\n";
VisitDeclContext(D);
Indent() << "}";
}
}
void DeclPrinter::VisitRecordDecl(RecordDecl *D) {