From: Simon Pilgrim Date: Thu, 17 Oct 2019 11:19:41 +0000 (+0000) Subject: JumpThreadingPass::UnfoldSelectInstr - silence static analyzer dyn_cast<> null derefe... X-Git-Tag: llvmorg-11-init~6288 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ec83e81877da19254adcdb2e80861eec19ea928;p=platform%2Fupstream%2Fllvm.git JumpThreadingPass::UnfoldSelectInstr - 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. llvm-svn: 375103 --- diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index ef02318..5e983ad 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -2433,7 +2433,7 @@ void JumpThreadingPass::UnfoldSelectInstr(BasicBlock *Pred, BasicBlock *BB, // |----- // v // BB - BranchInst *PredTerm = dyn_cast(Pred->getTerminator()); + BranchInst *PredTerm = cast(Pred->getTerminator()); BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), "select.unfold", BB->getParent(), BB); // Move the unconditional branch to NewBB.