[clang] ec81c9b - [clang] Remove a redundant check in Mangle. NFC (#95071)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 11 02:24:50 PDT 2024


Author: Pavel Samolysov
Date: 2024-06-11T12:24:46+03:00
New Revision: ec81c9b1dd856dbe77b042e7d293e437b587d914

URL: https://github.com/llvm/llvm-project/commit/ec81c9b1dd856dbe77b042e7d293e437b587d914
DIFF: https://github.com/llvm/llvm-project/commit/ec81c9b1dd856dbe77b042e7d293e437b587d914.diff

LOG: [clang] Remove a redundant check in Mangle. NFC (#95071)

This addresses a review comment for PR #94987 Because that PR is a big
automatic change, this change was moved in a separate one.

Added: 
    

Modified: 
    clang/lib/AST/Mangle.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Mangle.cpp b/clang/lib/AST/Mangle.cpp
index 4af4d7c00c5cb..4fbf0e3b42dbc 100644
--- a/clang/lib/AST/Mangle.cpp
+++ b/clang/lib/AST/Mangle.cpp
@@ -301,9 +301,8 @@ void MangleContext::mangleBlock(const DeclContext *DC, const BlockDecl *BD,
   } else {
     assert((isa<NamedDecl>(DC) || isa<BlockDecl>(DC)) &&
            "expected a NamedDecl or BlockDecl");
-    if (isa<BlockDecl>(DC))
-      for (; isa_and_nonnull<BlockDecl>(DC); DC = DC->getParent())
-        (void) getBlockId(cast<BlockDecl>(DC), true);
+    for (; isa_and_nonnull<BlockDecl>(DC); DC = DC->getParent())
+      (void)getBlockId(cast<BlockDecl>(DC), true);
     assert((isa<TranslationUnitDecl>(DC) || isa<NamedDecl>(DC)) &&
            "expected a TranslationUnitDecl or a NamedDecl");
     if (const auto *CD = dyn_cast<CXXConstructorDecl>(DC))


        


More information about the cfe-commits mailing list