Use isa instead of dyn_cast (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 11 Jun 2022 18:15:52 +0000 (11:15 -0700)
committerKazu Hirata <kazu@google.com>
Sat, 11 Jun 2022 18:15:52 +0000 (11:15 -0700)
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/Sema/SemaOpenMP.cpp

index 21f7219..23b0df2 100644 (file)
@@ -3664,7 +3664,7 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) {
 
     // Fix up function declarations that were created for cpu_specific before
     // cpu_dispatch was known
-    if (!dyn_cast<llvm::GlobalIFunc>(IFunc)) {
+    if (!isa<llvm::GlobalIFunc>(IFunc)) {
       assert(cast<llvm::Function>(IFunc)->isDeclaration());
       auto *GI = llvm::GlobalIFunc::create(DeclTy, 0, Linkage, "", ResolverFunc,
                                            &getModule());
index 803e013..0615c81 100644 (file)
@@ -11966,8 +11966,8 @@ bool OpenMPAtomicCompareCaptureChecker::checkStmt(Stmt *S,
       UpdateStmt = S1;
       CondUpdateStmt = S2;
       // Check if form 45.
-      if (dyn_cast<BinaryOperator>(BO->getRHS()->IgnoreImpCasts()) &&
-          dyn_cast<IfStmt>(S2))
+      if (isa<BinaryOperator>(BO->getRHS()->IgnoreImpCasts()) &&
+          isa<IfStmt>(S2))
         return checkForm45(CS, ErrorInfo);
       // It cannot be set before we the check for form45.
       IsPostfixUpdate = true;