1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Add insertelement and shufflevector constantexpr support

llvm-svn: 27520
This commit is contained in:
Chris Lattner 2006-04-08 03:53:34 +00:00
parent 2bab033f26
commit 6be33112a7

View File

@ -1547,8 +1547,17 @@ ConstExpr: CAST '(' ConstVal TO Types ')' {
if ($5->getType() != Type::UIntTy)
ThrowException("Second operand of extractelement must be uint!");
$$ = ConstantExpr::getExtractElement($3, $5);
}
| INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' {
$$ = ConstantExpr::getInsertElement($3, $5, $7);
}
| SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' {
if (!ShuffleVectorInst::isValidOperands($3, $5, $7))
ThrowException("Invalid shufflevector operands!");
$$ = ConstantExpr::getShuffleVector($3, $5, $7);
};
// ConstVector - A list of comma separated constants.
ConstVector : ConstVector ',' ConstVal {
($$ = $1)->push_back($3);