From: Fangrui Song Date: Wed, 26 Sep 2018 06:28:14 +0000 (+0000) Subject: [Frontend] Tidy up -print-decl-contexts conditions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=721671a64123df96e44a1cdef45f82525f888de0;p=clang [Frontend] Tidy up -print-decl-contexts conditions The existing conditions are not consistent. Some have braces and define a temporary Decl while others simply call `<< *cast(I)` (mostly the NamedDecl overload of operator<<). Just use the latter for consistency and brevity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343072 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 2a8bfef68e..6e2c87db29 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -442,75 +442,53 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, PrintDeclContext(DC, Indentation+2); break; } - case Decl::IndirectField: { - IndirectFieldDecl* IFD = cast(I); - Out << " " << *IFD << '\n'; + case Decl::IndirectField: + Out << " " << *cast(I) << '\n'; break; - } - case Decl::Label: { - LabelDecl *LD = cast(I); - Out << "