From 38b299322ceb498e84d8789ec9a4d9cbfd4e88e8 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 27 Sep 2019 15:49:10 +0000 Subject: [PATCH] SCCP - silence static analyzer dyn_cast null dereference warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast directly and if not assert will fire for us. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373095 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/SCCP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 0ce967c8d0b..10fbdc8aacd 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/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 ConstVals; - auto *ST = dyn_cast(V->getType()); + auto *ST = cast(V->getType()); for (unsigned i = 0, e = ST->getNumElements(); i != e; ++i) { LatticeVal V = IVs[i]; ConstVals.push_back(V.isConstant() -- 2.50.1