Skip to content

Commit

Permalink
[OpenMPOpt] Use cast<> instead of dyn_cast<> to avoid dereference of …
Browse files Browse the repository at this point in the history
…nullptr. NFC
  • Loading branch information
RKSimon committed Jan 8, 2022
1 parent b5d2e23 commit 274359c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 274359c

Please sign in to comment.