diff options
author | Michael Ilseman <milseman@apple.com> | 2014-12-15 18:48:43 +0000 |
---|---|---|
committer | Michael Ilseman <milseman@apple.com> | 2014-12-15 18:48:43 +0000 |
commit | addddc441f9c7fbd4ed70bc5a3256c385599929d (patch) | |
tree | d418ffd0237296eef0ec82e40c001e7771dc66c3 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | b736bf38990c4d474b1267f90c0706a3c983a10f (diff) | |
download | bcm5719-llvm-addddc441f9c7fbd4ed70bc5a3256c385599929d.tar.gz bcm5719-llvm-addddc441f9c7fbd4ed70bc5a3256c385599929d.zip |
Silence more static analyzer warnings.
Add in definedness checks for shift operators, null checks when
pointers are assumed by the code to be non-null, and explicit
unreachables.
llvm-svn: 224255
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 8208c125374..3fce38e2e3d 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -8577,7 +8577,9 @@ static SDValue PerformBFICombine(SDNode *N, unsigned InvMask = cast<ConstantSDNode>(N->getOperand(2))->getZExtValue(); unsigned LSB = countTrailingZeros(~InvMask); unsigned Width = (32 - countLeadingZeros(~InvMask)) - LSB; - unsigned Mask = (1 << Width)-1; + assert(Width < std::numeric_limits<unsigned>::digits && + "undefined behavior"); + unsigned Mask = (1u << Width) - 1; unsigned Mask2 = N11C->getZExtValue(); if ((Mask & (~Mask2)) == 0) return DCI.DAG.getNode(ARMISD::BFI, SDLoc(N), N->getValueType(0), |