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);