From: Simon Pilgrim Date: Sun, 22 Sep 2019 17:45:05 +0000 (+0000) Subject: ConstantHoisting - Silence static analyzer dyn_cast null dereference... X-Git-Tag: llvmorg-11-init~8646 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db05a482bc52dd48685760c8413d6a1f0ec7ab89;p=platform%2Fupstream%2Fllvm.git ConstantHoisting - Silence static analyzer dyn_cast null dereference warning. NFCI. llvm-svn: 372517 --- diff --git a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp index ff9e6d9..9f340af 100644 --- a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp +++ b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp @@ -401,7 +401,7 @@ void ConstantHoistingPass::collectConstantCandidates( return; // Get offset from the base GV. - PointerType *GVPtrTy = dyn_cast(BaseGV->getType()); + PointerType *GVPtrTy = cast(BaseGV->getType()); IntegerType *PtrIntTy = DL->getIntPtrType(*Ctx, GVPtrTy->getAddressSpace()); APInt Offset(DL->getTypeSizeInBits(PtrIntTy), /*val*/0, /*isSigned*/true); auto *GEPO = cast(ConstExpr);