Skip to content

[clang] Remove a redundant check in Mangle. NFC #95071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

samolisov
Copy link
Contributor

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

This addresses a review comment for PR llvm#94987 Because that PR is a big
automatic change, this change was moved in a separate one.
@samolisov samolisov requested a review from NagyDonat June 11, 2024 02:36
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jun 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 11, 2024

@llvm/pr-subscribers-clang

Author: Pavel Samolysov (samolisov)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/95071.diff

1 Files Affected:

  • (modified) clang/lib/AST/Mangle.cpp (+2-3)
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))

@samolisov samolisov merged commit ec81c9b into llvm:main Jun 11, 2024
8 of 10 checks passed
@samolisov samolisov deleted the clang/remove-redundant-isa-block-decl-check branch June 11, 2024 09:24
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Jun 12, 2024
This addresses a review comment for PR llvm#94987 Because that PR is a big
automatic change, this change was moved in a separate one.
@HerrCai0907 HerrCai0907 mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants