forked from OSchip/llvm-project
AST printing for scoped enumerations and enumerations with a fixed underlying type, from Daniel Wallin
llvm-svn: 120576
This commit is contained in:
parent
85df0ccafd
commit
ec0e366163
|
@ -307,10 +307,23 @@ void DeclPrinter::VisitTypedefDecl(TypedefDecl *D) {
|
|||
}
|
||||
|
||||
void DeclPrinter::VisitEnumDecl(EnumDecl *D) {
|
||||
Out << "enum " << D << " {\n";
|
||||
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) {
|
||||
Out << D->getKindName();
|
||||
|
|
Loading…
Reference in New Issue