From 867c39e8c4a2ccdbc1edae45966dc5f3e910954b Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Tue, 13 Jan 2009 02:41:08 +0000 Subject: [PATCH] Improve DeclContextPrinter: print enum name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62140 91177308-0d34-0410-b5e6-96231b3b80d8 --- Driver/ASTConsumers.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp index 17763f63bd..5bafd0928b 100644 --- a/Driver/ASTConsumers.cpp +++ b/Driver/ASTConsumers.cpp @@ -586,9 +586,15 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << ND->getNameAsString(); break; } - case Decl::Enum: - Out << "[enum]"; + case Decl::Enum: { + EnumDecl* ED = EnumDecl::castFromDeclContext(DC); + if (ED->isDefinition()) + Out << "[enum] "; + else + Out << " "; + Out << ED->getNameAsString(); break; + } case Decl::Record: { RecordDecl* RD = RecordDecl::castFromDeclContext(DC); if (RD->isDefinition())