forked from OSchip/llvm-project
ConstantHoisting - Silence static analyzer dyn_cast<PointerType> null dereference warning. NFCI.
llvm-svn: 372517
This commit is contained in:
parent
91d5c2a035
commit
db05a482bc
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue