[llvm] 25dd99f - Fix "pointer is null" static analyzer warning. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 9 04:44:29 PST 2020
Author: Simon Pilgrim
Date: 2020-01-09T12:37:38Z
New Revision: 25dd99fab205619ef90d0da23bcfba3c9f762e5e
URL: https://github.com/llvm/llvm-project/commit/25dd99fab205619ef90d0da23bcfba3c9f762e5e
DIFF: https://github.com/llvm/llvm-project/commit/25dd99fab205619ef90d0da23bcfba3c9f762e5e.diff
LOG: Fix "pointer is null" static analyzer warning. NFCI.
Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately).
Added:
Modified:
llvm/lib/IR/Verifier.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 50648ba17945..d232946af294 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -4779,7 +4779,7 @@ void Verifier::visitConstrainedFPIntrinsic(ConstrainedFPIntrinsic &FPI) {
case Intrinsic::experimental_constrained_fcmp:
case Intrinsic::experimental_constrained_fcmps: {
- auto Pred = dyn_cast<ConstrainedFPCmpIntrinsic>(&FPI)->getPredicate();
+ auto Pred = cast<ConstrainedFPCmpIntrinsic>(&FPI)->getPredicate();
Assert(CmpInst::isFPPredicate(Pred),
"invalid predicate for constrained FP comparison intrinsic", &FPI);
break;
More information about the llvm-commits
mailing list