Skip to content

Commit 5a81db3

Browse files
authored
[NFC][Clang] Use isa_and_nonnull instead of VD && isa<VarDecl>(VD) (#93207)
This issue was found in #86960. But I'd like to avoid mixing together a bunch of cleanups with actual changes. Signed-off-by: yronglin <[email protected]>
1 parent b8efe37 commit 5a81db3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ pushTemporaryCleanup(CodeGenFunction &CGF, const MaterializeTemporaryExpr *M,
317317
CleanupKind CleanupKind;
318318
if (Lifetime == Qualifiers::OCL_Strong) {
319319
const ValueDecl *VD = M->getExtendingDecl();
320-
bool Precise =
321-
VD && isa<VarDecl>(VD) && VD->hasAttr<ObjCPreciseLifetimeAttr>();
320+
bool Precise = isa_and_nonnull<VarDecl>(VD) &&
321+
VD->hasAttr<ObjCPreciseLifetimeAttr>();
322322
CleanupKind = CGF.getARCCleanupKind();
323323
Destroy = Precise ? &CodeGenFunction::destroyARCStrongPrecise
324324
: &CodeGenFunction::destroyARCStrongImprecise;

0 commit comments

Comments
 (0)