Skip to content

Commit

Permalink
[NFC][Clang] Use isa_and_nonnull instead of VD && isa<VarDecl>(VD) (
Browse files Browse the repository at this point in the history
llvm#93207)

This issue was found in llvm#86960.
But I'd like to avoid mixing together a bunch of cleanups with actual
changes.

Signed-off-by: yronglin <[email protected]>
  • Loading branch information
yronglin authored May 23, 2024
1 parent b8efe37 commit 5a81db3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CGExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ pushTemporaryCleanup(CodeGenFunction &CGF, const MaterializeTemporaryExpr *M,
CleanupKind CleanupKind;
if (Lifetime == Qualifiers::OCL_Strong) {
const ValueDecl *VD = M->getExtendingDecl();
bool Precise =
VD && isa<VarDecl>(VD) && VD->hasAttr<ObjCPreciseLifetimeAttr>();
bool Precise = isa_and_nonnull<VarDecl>(VD) &&
VD->hasAttr<ObjCPreciseLifetimeAttr>();
CleanupKind = CGF.getARCCleanupKind();
Destroy = Precise ? &CodeGenFunction::destroyARCStrongPrecise
: &CodeGenFunction::destroyARCStrongImprecise;
Expand Down

0 comments on commit 5a81db3

Please sign in to comment.