For PR1245:

Account for the sign bit when computing the number of bits required for
a negative integer literal constant.

llvm-svn: 35046
This commit is contained in:
Reid Spencer 2007-03-09 19:26:52 +00:00
parent 10a05b538d
commit f860fd3370

View File

@ -377,7 +377,7 @@ shufflevector { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); }
}
}
{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)