r351604 - [ASTDump] NFC: Remove redundant condition

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


Author: steveire
Date: Fri Jan 18 14:15:05 2019
New Revision: 351604

URL: http://llvm.org/viewvc/llvm-project?rev=351604&view=rev
Log:
[ASTDump] NFC: Remove redundant condition

These conditions are duplicated from the dumpDeclContext function called
within the if(). This is presumably an attempt to avoid calling the
function in the case it will do nothing.

That may have made sense in the past if the code was different, but it
doesn't make sense now.

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=351604&r1=351603&r2=351604&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Fri Jan 18 14:15:05 2019
@@ -514,10 +514,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 &&
-          (DC->hasExternalLexicalStorage() ||
-           (Deserialize ? DC->decls_begin() != DC->decls_end()
-                        : DC->noload_decls_begin() != DC->noload_decls_end())))
+      if (DC)
         dumpDeclContext(DC);
     }
   });




More information about the cfe-commits mailing list