diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-08 03:53:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-08 03:53:34 +0000 |
commit | ca73cd88301bb38e27d39fd25fe15521b908cab6 (patch) | |
tree | 8691c8891ad71bd8c683206fdd684ad929cb0fbd /lib | |
parent | 06a801a38c43716564b3b9fb6c7a04ed242ecb61 (diff) |
Add insertelement and shufflevector constantexpr support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index d77b7eebfc..d95ea31beb 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -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); |