forked from OSchip/llvm-project
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:
parent
368faf9acd
commit
3fcf0c24a9
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue