From: Simon Pilgrim Date: Sun, 22 Sep 2019 21:01:23 +0000 (+0000) Subject: Verifier - silence static analyzer dyn_cast null dereference warnings... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0d965cd9ff41fcbeda62a0b4bd85c0f7428bff9;p=llvm Verifier - silence static analyzer dyn_cast null dereference warnings. NFCI. The static analyzer is warning about potential null dereferences, but we should be able to use cast directly and if not assert will fire for us. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372529 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index ebd4125f184..4cd8b367d53 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -2722,8 +2722,8 @@ void Verifier::visitPtrToIntInst(PtrToIntInst &I) { &I); if (SrcTy->isVectorTy()) { - VectorType *VSrc = dyn_cast(SrcTy); - VectorType *VDest = dyn_cast(DestTy); + VectorType *VSrc = cast(SrcTy); + VectorType *VDest = cast(DestTy); Assert(VSrc->getNumElements() == VDest->getNumElements(), "PtrToInt Vector width mismatch", &I); } @@ -2747,8 +2747,8 @@ void Verifier::visitIntToPtrInst(IntToPtrInst &I) { Assert(SrcTy->isVectorTy() == DestTy->isVectorTy(), "IntToPtr type mismatch", &I); if (SrcTy->isVectorTy()) { - VectorType *VSrc = dyn_cast(SrcTy); - VectorType *VDest = dyn_cast(DestTy); + VectorType *VSrc = cast(SrcTy); + VectorType *VDest = cast(DestTy); Assert(VSrc->getNumElements() == VDest->getNumElements(), "IntToPtr Vector width mismatch", &I); }