summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2022-01-08 13:47:35 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2022-01-08 13:47:35 +0000
commit274359cf099407172fee7f0bd704b8ff41d826ec (patch)
tree029f8ba048b478cd8172cee6a2cd923663ff7959
parentb5d2e232b8a11a932826b095d67c53e7564d7960 (diff)
downloadllvm-274359cf099407172fee7f0bd704b8ff41d826ec.tar.gz
[OpenMPOpt] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr. NFC
-rw-r--r--llvm/lib/Transforms/IPO/OpenMPOpt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index a28c850f8c5b..2b29a0c93faa 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -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()