Skip to content

Commit

Permalink
SystemZISelLowering - supportedAddressingMode - silence static analyz…
Browse files Browse the repository at this point in the history
…er 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: 375430
  • Loading branch information
RKSimon committed Oct 21, 2019
1 parent 57e8f0b commit ae99712
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ supportedAddressingMode(Instruction *I, bool HasVector) {
}

if (isa<LoadInst>(I) && I->hasOneUse()) {
auto *SingleUser = dyn_cast<Instruction>(*I->user_begin());
auto *SingleUser = cast<Instruction>(*I->user_begin());
if (SingleUser->getParent() == I->getParent()) {
if (isa<ICmpInst>(SingleUser)) {
if (auto *C = dyn_cast<ConstantInt>(SingleUser->getOperand(1)))
Expand Down

0 comments on commit ae99712

Please sign in to comment.