forked from OSchip/llvm-project
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:
parent
436d5b335a
commit
623b0e6963
llvm/lib/Transforms/Scalar
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue