diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-24 11:17:06 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-24 11:17:06 +0000 |
commit | bc58230e29d53651c9cd17b97974a20ae87fef02 (patch) | |
tree | 1edc26f3bcd4a455effd918703285f32bb34a976 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 7e3c74bc63f97dd8fa354e6f2153ab8b3d88082a (diff) | |
download | bcm5719-llvm-bc58230e29d53651c9cd17b97974a20ae87fef02.tar.gz bcm5719-llvm-bc58230e29d53651c9cd17b97974a20ae87fef02.zip |
SimplifyCFG - silence static analyzer dyn_cast<Instruction> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<Instruction> directly and if not assert will fire for us.
llvm-svn: 372726
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index f1f16ee3da8..9b14aa843d6 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -632,8 +632,7 @@ private: /// vector. /// One "Extra" case is allowed to differ from the other. void gather(Value *V) { - Instruction *I = dyn_cast<Instruction>(V); - bool isEQ = (I->getOpcode() == Instruction::Or); + bool isEQ = (cast<Instruction>(V)->getOpcode() == Instruction::Or); // Keep a stack (SmallVector for efficiency) for depth-first traversal SmallVector<Value *, 8> DFT; |