]> granicus.if.org Git - clang/commitdiff
[ASTDump] NFC: Remove redundant condition
authorStephen Kelly <steveire@gmail.com>
Fri, 18 Jan 2019 22:15:05 +0000 (22:15 +0000)
committerStephen Kelly <steveire@gmail.com>
Fri, 18 Jan 2019 22:15:05 +0000 (22:15 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351604 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTDumper.cpp

index 678a6b5fc851b2eb16f655d54f14b007246cd53e..2b9b132eea7a9b86214ed96eae7dc0a3f079ac6a 100644 (file)
@@ -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);
     }
   });