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
This commit is contained in:
Simon Pilgrim 2019-09-27 15:49:10 +00:00
parent 436d5b335a
commit 623b0e6963
1 changed files with 1 additions and 1 deletions
llvm/lib/Transforms/Scalar

View File

@ -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()