[llvm] r375103 - JumpThreadingPass::UnfoldSelectInstr - silence static analyzer dyn_cast<> null dereference warning. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 04:19:41 PDT 2019
Author: rksimon
Date: Thu Oct 17 04:19:41 2019
New Revision: 375103
URL: http://llvm.org/viewvc/llvm-project?rev=375103&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=375103&r1=375102&r2=375103&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Oct 17 04:19:41 2019
@@ -2433,7 +2433,7 @@ void JumpThreadingPass::UnfoldSelectInst
// |-----
// v
// BB
- BranchInst *PredTerm = dyn_cast<BranchInst>(Pred->getTerminator());
+ BranchInst *PredTerm = cast<BranchInst>(Pred->getTerminator());
BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), "select.unfold",
BB->getParent(), BB);
// Move the unconditional branch to NewBB.
More information about the llvm-commits
mailing list