ConstantHoisting - Silence static analyzer dyn_cast<PointerType> null dereference warning. NFCI.

llvm-svn: 372517
This commit is contained in:
Simon Pilgrim 2019-09-22 17:45:05 +00:00
parent 91d5c2a035
commit db05a482bc
1 changed files with 1 additions and 1 deletions

View File

@ -401,7 +401,7 @@ void ConstantHoistingPass::collectConstantCandidates(
return;
// Get offset from the base GV.
PointerType *GVPtrTy = dyn_cast<PointerType>(BaseGV->getType());
PointerType *GVPtrTy = cast<PointerType>(BaseGV->getType());
IntegerType *PtrIntTy = DL->getIntPtrType(*Ctx, GVPtrTy->getAddressSpace());
APInt Offset(DL->getTypeSizeInBits(PtrIntTy), /*val*/0, /*isSigned*/true);
auto *GEPO = cast<GEPOperator>(ConstExpr);