[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l llvmAsmParser.y
Chris Lattner
lattner at cs.uiuc.edu
Fri Apr 7 18:18:48 PDT 2006
Changes in directory llvm/lib/AsmParser:
Lexer.l updated: 1.72 -> 1.73
llvmAsmParser.y updated: 1.250 -> 1.251
---
Log message:
Parse shufflevector
---
Diffs of the changes: (+7 -1)
Lexer.l | 1 +
llvmAsmParser.y | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.72 llvm/lib/AsmParser/Lexer.l:1.73
--- llvm/lib/AsmParser/Lexer.l:1.72 Wed Feb 15 01:02:59 2006
+++ llvm/lib/AsmParser/Lexer.l Fri Apr 7 20:18:35 2006
@@ -277,6 +277,7 @@
extractelement { RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); }
insertelement { RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); }
+shufflevector { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); }
{VarID} {
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.250 llvm/lib/AsmParser/llvmAsmParser.y:1.251
--- llvm/lib/AsmParser/llvmAsmParser.y:1.250 Sat Mar 4 01:53:16 2006
+++ llvm/lib/AsmParser/llvmAsmParser.y Fri Apr 7 20:18:35 2006
@@ -998,7 +998,7 @@
// Other Operators
%type <OtherOpVal> ShiftOps
%token <OtherOpVal> PHI_TOK CAST SELECT SHL SHR VAARG
-%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT
+%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
%token VAARG_old VANEXT_old //OBSOLETE
@@ -2260,6 +2260,11 @@
ThrowException("Third operand of insertelement must be uint!");
$$ = new InsertElementInst($2, $4, $6);
}
+ | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal {
+ if (!ShuffleVectorInst::isValidOperands($2, $4, $6))
+ ThrowException("Invalid shufflevector operands!");
+ $$ = new ShuffleVectorInst($2, $4, $6);
+ }
| PHI_TOK PHIList {
const Type *Ty = $2->front().first->getType();
if (!Ty->isFirstClassType())
More information about the llvm-commits
mailing list