Handle shifts >= 32 bits.

llvm-svn: 14291
This commit is contained in:
Misha Brukman 2004-06-21 18:01:47 +00:00
parent 11f74d7072
commit 6752fb58b6
1 changed files with 2 additions and 2 deletions

View File

@ -61,10 +61,10 @@ Init *BitsRecTy::convertValue(BitInit *UI) {
// appropriate bits... // appropriate bits...
// //
Init *BitsRecTy::convertValue(IntInit *II) { Init *BitsRecTy::convertValue(IntInit *II) {
int Value = II->getValue(); int64_t Value = II->getValue();
// Make sure this bitfield is large enough to hold the integer value... // Make sure this bitfield is large enough to hold the integer value...
if (Value >= 0) { if (Value >= 0) {
if (Value & ~((1 << Size)-1)) if (Value & ~((1LL << Size)-1))
return 0; return 0;
} else { } else {
if ((Value >> Size) != -1 || ((Value & (1 << Size-1)) == 0)) if ((Value >> Size) != -1 || ((Value & (1 << Size-1)) == 0))