mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Regenerate.
llvm-svn: 34797
This commit is contained in:
parent
30eac3e0b1
commit
29c98b589c
File diff suppressed because it is too large
Load Diff
@ -1713,22 +1713,17 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
|
|||||||
GEN_ERROR("Constant value doesn't fit in type");
|
GEN_ERROR("Constant value doesn't fit in type");
|
||||||
APInt Val(64, $2);
|
APInt Val(64, $2);
|
||||||
uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
|
uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
|
||||||
if (BitWidth > 64)
|
Val.sextOrTrunc(BitWidth);
|
||||||
Val.sext(BitWidth);
|
$$ = ConstantInt::get(Val);
|
||||||
else if (BitWidth < 64)
|
|
||||||
Val.trunc(BitWidth);
|
|
||||||
$$ = ConstantInt::get($1, Val);
|
|
||||||
CHECK_FOR_ERROR
|
CHECK_FOR_ERROR
|
||||||
}
|
}
|
||||||
| IntType ESAPINTVAL { // arbitrary precision integer constants
|
| IntType ESAPINTVAL { // arbitrary precision integer constants
|
||||||
uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
|
uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
|
||||||
if ($2->getBitWidth() > BitWidth) {
|
if ($2->getBitWidth() > BitWidth) {
|
||||||
GEN_ERROR("Constant value does not fit in type");
|
GEN_ERROR("Constant value does not fit in type");
|
||||||
} else if ($2->getBitWidth() < BitWidth)
|
}
|
||||||
$2->sext(BitWidth);
|
$2->sextOrTrunc(BitWidth);
|
||||||
else if ($2->getBitWidth() > BitWidth)
|
$$ = ConstantInt::get(*$2);
|
||||||
$2->trunc(BitWidth);
|
|
||||||
$$ = ConstantInt::get($1, *$2);
|
|
||||||
delete $2;
|
delete $2;
|
||||||
CHECK_FOR_ERROR
|
CHECK_FOR_ERROR
|
||||||
}
|
}
|
||||||
@ -1737,18 +1732,16 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
|
|||||||
GEN_ERROR("Constant value doesn't fit in type");
|
GEN_ERROR("Constant value doesn't fit in type");
|
||||||
uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
|
uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
|
||||||
APInt Val(BitWidth, $2);
|
APInt Val(BitWidth, $2);
|
||||||
$$ = ConstantInt::get($1, Val);
|
$$ = ConstantInt::get(Val);
|
||||||
CHECK_FOR_ERROR
|
CHECK_FOR_ERROR
|
||||||
}
|
}
|
||||||
| IntType EUAPINTVAL { // arbitrary precision integer constants
|
| IntType EUAPINTVAL { // arbitrary precision integer constants
|
||||||
uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
|
uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
|
||||||
if ($2->getBitWidth() > BitWidth) {
|
if ($2->getBitWidth() > BitWidth) {
|
||||||
GEN_ERROR("Constant value does not fit in type");
|
GEN_ERROR("Constant value does not fit in type");
|
||||||
} else if ($2->getBitWidth() < BitWidth)
|
}
|
||||||
$2->zext(BitWidth);
|
$2->zextOrTrunc(BitWidth);
|
||||||
else if ($2->getBitWidth() > BitWidth)
|
$$ = ConstantInt::get(*$2);
|
||||||
$2->trunc(BitWidth);
|
|
||||||
$$ = ConstantInt::get($1, *$2);
|
|
||||||
delete $2;
|
delete $2;
|
||||||
CHECK_FOR_ERROR
|
CHECK_FOR_ERROR
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user