Author: ddunbar
Date: Thu Oct 16 01:39:30 2008
New Revision: 57629

URL: http://llvm.org/viewvc/llvm-project?rev=57629&view=rev
Log:
Simplify overflow-on-add check in NumericLiteralParser::GetIntegerValue.

Modified:
    cfe/trunk/lib/Lex/LiteralSupport.cpp

Modified: cfe/trunk/lib/Lex/LiteralSupport.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/LiteralSupport.cpp?rev=57629&r1=57628&r2=57629&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/lib/Lex/LiteralSupport.cpp Thu Oct 16 01:39:30 2008
@@ -481,10 +481,9 @@
     Val *= RadixVal;
     OverflowOccurred |= Val.udiv(RadixVal) != OldVal;
 
-    OldVal = Val;
     // Add value, did overflow occur on the value?
+    //   (a + b) ult b  <=> overflow
     Val += CharVal;
-    OverflowOccurred |= Val.ult(OldVal);
     OverflowOccurred |= Val.ult(CharVal);
   }
   return OverflowOccurred;


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to