[OpenMPOpt] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr. NFC
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 8 Jan 2022 13:47:35 +0000 (13:47 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 8 Jan 2022 13:47:35 +0000 (13:47 +0000)
llvm/lib/Transforms/IPO/OpenMPOpt.cpp

index a28c850..2b29a0c 100644 (file)
@@ -2754,7 +2754,7 @@ struct AAHeapToSharedFunction : public AAHeapToShared {
       if (FreeCalls.size() != 1)
         continue;
 
-      ConstantInt *AllocSize = dyn_cast<ConstantInt>(CB->getArgOperand(0));
+      auto *AllocSize = cast<ConstantInt>(CB->getArgOperand(0));
 
       LLVM_DEBUG(dbgs() << TAG << "Replace globalization call " << *CB
                         << " with " << AllocSize->getZExtValue()