[PATCH] Add missing Decl::Kind for -print-decl-contexts

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 29 15:35:28 PST 2016


---
 lib/Frontend/ASTConsumers.cpp | 37 ++++++++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp
index bd2ee06d16..987b8ca398 100644
--- a/lib/Frontend/ASTConsumers.cpp
+++ b/lib/Frontend/ASTConsumers.cpp
@@ -405,6 +405,22 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
       PrintDeclContext(DC, Indentation+2);
       break;
     }
+    case Decl::AccessSpec: {
+      Out << "<AccessSpec>\n";
+      break;
+    }
+    case Decl::ClassTemplate: {
+      Out << "<ClassTemplate> " << *cast<ClassTemplateDecl>(I) << '\n';
+      break;
+    }
+    case Decl::ClassTemplateSpecialization: {
+      Out << "<ClassTemplateSpecialization> " << *cast<ClassTemplateSpecializationDecl>(I) << '\n';
+      break;
+    }
+    case Decl::ClassTemplatePartialSpecialization: {
+      Out << "<ClassTemplatePartialSpecialization> " << *cast<ClassTemplatePartialSpecializationDecl>(I) << '\n';
+      break;
+    }
     case Decl::IndirectField: {
       IndirectFieldDecl* IFD = cast<IndirectFieldDecl>(I);
       Out << "<IndirectField> " << *IFD << '\n';
@@ -420,6 +436,10 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
       Out << "<field> " << *FD << '\n';
       break;
     }
+    case Decl::Friend: {
+      Out << "<Friend>\n";
+      break;
+    }
     case Decl::Typedef:
     case Decl::TypeAlias: {
       TypedefNameDecl* TD = cast<TypedefNameDecl>(I);
@@ -460,6 +480,14 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
       Out << "<file-scope asm>\n";
       break;
     }
+    case Decl::Using: {
+      Out << "<Using> " << *cast<UsingDecl>(I) << '\n';
+      break;
+    }
+    case Decl::UsingShadow: {
+      Out << "<UsingShadow> " << *cast<UsingShadowDecl>(I) << '\n';
+      break;
+    }
     case Decl::UsingDirective: {
       Out << "<using directive>\n";
       break;
@@ -469,15 +497,14 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
       Out << "<namespace alias> " << *NAD << '\n';
       break;
     }
-    case Decl::ClassTemplate: {
-      ClassTemplateDecl *CTD = cast<ClassTemplateDecl>(I);
-      Out << "<class template> " << *CTD << '\n';
-      break;
-    }
     case Decl::OMPThreadPrivate: {
       Out << "<omp threadprivate> " << '"' << I << "\"\n";
       break;
     }
+    case Decl::VarTemplate: {
+      Out << "<VarTemplate> " << *cast<VarTemplateDecl>(I) << '\n';
+      break;
+    }
     default:
       Out << "DeclKind: " << DK << '"' << I << "\"\n";
       llvm_unreachable("decl unhandled");
-- 
2.11.0



More information about the cfe-commits mailing list