[PATCH] Add missing Decl::Kind for -print-decl-contexts
Alex L via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 3 03:48:21 PST 2017
Thanks for working on this patch! I'm sorry to say but I had an earlier
patch in review that fixes this issue (https://reviews.llvm.org/D26964). I
think my patch covers all of the decl kinds that are fixed by this patch. I
plan on committing my patch today.
Alex
On 29 December 2016 at 23:35, Fangrui Song via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> ---
> 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
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170103/7ddf76e8/attachment.html>
More information about the cfe-commits
mailing list