[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l

Reid Spencer reid at x10sys.com
Fri Mar 9 11:27:09 PST 2007



Changes in directory llvm/lib/AsmParser:

Lexer.l updated: 1.99 -> 1.100
---
Log message:

For PR1245: http://llvm.org/PR1245 :
Account for the sign bit when computing the number of bits required for 
a negative integer literal constant. 


---
Diffs of the changes:  (+1 -1)

 Lexer.l |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.99 llvm/lib/AsmParser/Lexer.l:1.100
--- llvm/lib/AsmParser/Lexer.l:1.99	Tue Feb 27 20:24:27 2007
+++ llvm/lib/AsmParser/Lexer.l	Fri Mar  9 13:26:52 2007
@@ -377,7 +377,7 @@
                   }
                 }
 {NInteger}      { int len = strlen(yytext); 
-                  uint32_t numBits = (((len-1) * 64) / 19) + 1;
+                  uint32_t numBits = (((len-1) * 64) / 19) + 2;
                   APInt Tmp(numBits, yytext, len, 10);
                   uint32_t minBits = Tmp.getMinSignedBits();
                   if (minBits > 0 && minBits < numBits)






More information about the llvm-commits mailing list