1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Tighten up handling of checks for shift instructions

llvm-svn: 9191
This commit is contained in:
Chris Lattner 2003-10-17 05:11:44 +00:00
parent 5a1f705c88
commit 17f8f2e317

View File

@ -1093,8 +1093,8 @@ ConstExpr: CAST '(' ConstVal TO Types ')' {
| ShiftOps '(' ConstVal ',' ConstVal ')' {
if ($5->getType() != Type::UByteTy)
ThrowException("Shift count for shift constant must be unsigned byte!");
if (!$3->getType()->isIntegral())
ThrowException("Shift constant expression requires integral operand!");
if (!$3->getType()->isInteger())
ThrowException("Shift constant expression requires integer operand!");
$$ = ConstantExpr::getShift($1, $3, $5);
};
@ -1631,6 +1631,8 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
| ShiftOps ResolvedVal ',' ResolvedVal {
if ($4->getType() != Type::UByteTy)
ThrowException("Shift amount must be ubyte!");
if (!$2->getType()->isInteger())
ThrowException("Shift constant expression requires integer operand!");
$$ = new ShiftInst($1, $2, $4);
}
| CAST ResolvedVal TO Types {