Author: Jun Zhang
Date: 2022-07-31T13:03:24+08:00
New Revision: 3da13953834eb31b41949e92886f6fb7f3fd63fc

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

LOG: [CodeGen][NFC] Use isa_and_nonnull instead of explicit check

Signed-off-by: Jun Zhang <j...@junz.org>

Added: 
    

Modified: 
    clang/lib/CodeGen/CodeGenModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index 8940cee37d3e6..579ebba7736da 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3974,7 +3974,7 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction(
     // All MSVC dtors other than the base dtor are linkonce_odr and delegate to
     // each other bottoming out with the base dtor.  Therefore we emit non-base
     // dtors on usage, even if there is no dtor definition in the TU.
-    if (D && isa<CXXDestructorDecl>(D) &&
+    if (isa_and_nonnull<CXXDestructorDecl>(D) &&
         getCXXABI().useThunkForDtorVariant(cast<CXXDestructorDecl>(D),
                                            GD.getDtorType()))
       addDeferredDeclToEmit(GD);


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to