[cfe-commits] r69046 - /cfe/trunk/lib/Lex/LiteralSupport.cpp

Sanjiv Gupta sanjiv.gupta at microchip.com
Tue Apr 14 09:46:38 PDT 2009


Author: sgupta
Date: Tue Apr 14 11:46:37 2009
New Revision: 69046

URL: http://llvm.org/viewvc/llvm-project?rev=69046&view=rev
Log:
Literal value calculation isn't likely to overflow on targets having int as 32 or less. Fixing the assert as it otherwise triggers for PIC16 which as i16 as int.

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=69046&r1=69045&r2=69046&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/lib/Lex/LiteralSupport.cpp Tue Apr 14 11:46:37 2009
@@ -632,10 +632,10 @@
   assert(begin[0] == '\'' && "Invalid token lexed");
   ++begin;
 
-  // FIXME: This assumes that 'int' is 32-bits in overflow calculation, and the
-  // size of "value".
-  assert(PP.getTargetInfo().getIntWidth() == 32 &&
-         "Assumes sizeof(int) == 4 for now");
+  // FIXME: This assumes that 'int' is not more than 32-bits in overflow 
+  // calculation, and the size of "value".
+  assert(PP.getTargetInfo().getIntWidth() <= 32 &&
+         "Assumes sizeof(int) <= 4 for now");
   // FIXME: This assumes that wchar_t is 32-bits for now.
   assert(PP.getTargetInfo().getWCharWidth() == 32 && 
          "Assumes sizeof(wchar_t) == 4 for now");





More information about the cfe-commits mailing list