r351605 - [ASTDump] NFC: Move variable into if() statement

Stephen Kelly via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 18 14:15:09 PST 2019


Author: steveire
Date: Fri Jan 18 14:15:09 2019
New Revision: 351605

URL: http://llvm.org/viewvc/llvm-project?rev=351605&view=rev
Log:
[ASTDump] NFC: Move variable into if() statement

Modified:
    cfe/trunk/lib/AST/ASTDumper.cpp

Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=351605&r1=351604&r2=351605&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Fri Jan 18 14:15:09 2019
@@ -513,8 +513,7 @@ void ASTDumper::dumpDecl(const Decl *D)
 
     // Decls within functions are visited by the body.
     if (!isa<FunctionDecl>(*D) && !isa<ObjCMethodDecl>(*D)) {
-      auto DC = dyn_cast<DeclContext>(D);
-      if (DC)
+      if (const auto *DC = dyn_cast<DeclContext>(D))
         dumpDeclContext(DC);
     }
   });




More information about the cfe-commits mailing list