For PR1245:

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35046 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-03-09 19:26:52 +00:00
parent 818c085232
commit 87707b90b1

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)