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,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) {
|
||||
|
|
Loading…
Reference in New Issue