summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-09-22 17:45:05 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-09-22 17:45:05 +0000
commitdb05a482bc52dd48685760c8413d6a1f0ec7ab89 (patch)
treee2c1b287c1fda0ec3747294ac50f4857b74dc186
parent91d5c2a035585ebfb1215237115ab439836fe54c (diff)
downloadbcm5719-llvm-db05a482bc52dd48685760c8413d6a1f0ec7ab89.tar.gz
bcm5719-llvm-db05a482bc52dd48685760c8413d6a1f0ec7ab89.zip
ConstantHoisting - Silence static analyzer dyn_cast<PointerType> null dereference warning. NFCI.
llvm-svn: 372517
-rw-r--r--llvm/lib/Transforms/Scalar/ConstantHoisting.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
index ff9e6d94d85..9f340afbf7c 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<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);
OpenPOWER on IntegriCloud