From: Simon Pilgrim Date: Mon, 21 Oct 2019 17:15:49 +0000 (+0000) Subject: GVNHoist - silence static analyzer dyn_cast<> null dereference warning in hasEHOrLoad... X-Git-Tag: llvmorg-11-init~6027 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57e8f0b05545ded4f2da1979ee9b19af55f3c004;p=platform%2Fupstream%2Fllvm.git GVNHoist - silence static analyzer dyn_cast<> null dereference warning in hasEHOrLoadsOnPath call. 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. llvm-svn: 375429 --- diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp index 1f01ba2..c87e414 100644 --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -539,7 +539,7 @@ private: // Check for unsafe hoistings due to side effects. if (K == InsKind::Store) { - if (hasEHOrLoadsOnPath(NewPt, dyn_cast(U), NBBsOnAllPaths)) + if (hasEHOrLoadsOnPath(NewPt, cast(U), NBBsOnAllPaths)) return false; } else if (hasEHOnPath(NewBB, OldBB, NBBsOnAllPaths)) return false;