diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-27 15:49:10 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-27 15:49:10 +0000 |
commit | 623b0e6963e5cbf59e180a9aadb1da8e61d84b47 (patch) | |
tree | d8060497b80240aef359177cc47eb079cbd09400 /llvm/lib/Transforms | |
parent | 436d5b335ae5ae0d015b9b6196da9e60c2c2690d (diff) | |
download | bcm5719-llvm-623b0e6963e5cbf59e180a9aadb1da8e61d84b47.tar.gz bcm5719-llvm-623b0e6963e5cbf59e180a9aadb1da8e61d84b47.zip |
SCCP - silence static analyzer dyn_cast<StructType> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<StructType> directly and if not assert will fire for us.
llvm-svn: 373095
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 0ce967c8d0b..10fbdc8aacd 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -1757,7 +1757,7 @@ static bool tryToReplaceWithConstant(SCCPSolver &Solver, Value *V) { [](const LatticeVal &LV) { return LV.isOverdefined(); })) return false; std::vector<Constant *> ConstVals; - auto *ST = dyn_cast<StructType>(V->getType()); + auto *ST = cast<StructType>(V->getType()); for (unsigned i = 0, e = ST->getNumElements(); i != e; ++i) { LatticeVal V = IVs[i]; ConstVals.push_back(V.isConstant() |