[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Chris Lattner
lattner at cs.uiuc.edu
Fri Apr 7 20:53:47 PDT 2006
Changes in directory llvm/lib/AsmParser:
llvmAsmParser.y updated: 1.251 -> 1.252
---
Log message:
Add insertelement and shufflevector constantexpr support
---
Diffs of the changes: (+9 -0)
llvmAsmParser.y | 9 +++++++++
1 files changed, 9 insertions(+)
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.251 llvm/lib/AsmParser/llvmAsmParser.y:1.252
--- llvm/lib/AsmParser/llvmAsmParser.y:1.251 Fri Apr 7 20:18:35 2006
+++ llvm/lib/AsmParser/llvmAsmParser.y Fri Apr 7 22:53:34 2006
@@ -1547,8 +1547,17 @@
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);
More information about the llvm-commits
mailing list