[llvm] r250404 - Silencing a -Wtype-limits warning; an unsigned value will always be >= 0; NFC.

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 06:55:44 PDT 2015


Author: aaronballman
Date: Thu Oct 15 08:55:43 2015
New Revision: 250404

URL: http://llvm.org/viewvc/llvm-project?rev=250404&view=rev
Log:
Silencing a -Wtype-limits warning; an unsigned value will always be >= 0; NFC.

Modified:
    llvm/trunk/lib/Analysis/ValueTracking.cpp

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=250404&r1=250403&r2=250404&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Thu Oct 15 08:55:43 2015
@@ -1382,7 +1382,7 @@ static void computeKnownBitsFromOperator
         unsigned BitsPossiblySet = BitWidth - KnownZero2.countPopulation();
         unsigned LeadingZeros =
           APInt(BitWidth, BitsPossiblySet).countLeadingZeros();
-        assert(LeadingZeros >= 0 && LeadingZeros <= BitWidth);
+        assert(LeadingZeros <= BitWidth);
         KnownZero |= APInt::getHighBitsSet(BitWidth, LeadingZeros);
         KnownOne &= ~KnownZero;
         // TODO: we could bound KnownOne using the lower bound on the number




More information about the llvm-commits mailing list