Skip to content

Commit

Permalink
[clang] Remove a redundant check in Mangle. NFC (#95071)
Browse files Browse the repository at this point in the history
This addresses a review comment for PR #94987 Because that PR is a big
automatic change, this change was moved in a separate one.
  • Loading branch information
samolisov authored Jun 11, 2024
1 parent 529b43c commit ec81c9b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions clang/lib/AST/Mangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit ec81c9b

Please sign in to comment.