[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Robert L. Bocchino Jr.
bocchino at persephone.cs.uiuc.edu
Tue Jan 10 11:06:29 PST 2006
Changes in directory llvm/lib/Bytecode/Reader:
Reader.cpp updated: 1.175 -> 1.176
---
Log message:
Added bytecode support for the extractelement operation.
---
Diffs of the changes: (+13 -0)
Reader.cpp | 13 +++++++++++++
1 files changed, 13 insertions(+)
Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.175 llvm/lib/Bytecode/Reader/Reader.cpp:1.176
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.175 Sat Nov 12 12:31:54 2005
+++ llvm/lib/Bytecode/Reader/Reader.cpp Tue Jan 10 13:04:39 2006
@@ -717,6 +717,13 @@
Result = new VAArgInst(foo, getSanitizedType(Oprnds[1]));
break;
}
+ case Instruction::ExtractElement: {
+ if (Oprnds.size() != 2)
+ throw std::string("Invalid extractelement instruction!");
+ Result = new ExtractElementInst(getValue(iType, Oprnds[0]),
+ getValue(Type::UIntTyID, Oprnds[1]));
+ break;
+ }
case Instruction::Cast:
Result = new CastInst(getValue(iType, Oprnds[0]),
getSanitizedType(Oprnds[1]));
@@ -1439,6 +1446,12 @@
error("Select instruction must have three arguments.");
Constant* Result = ConstantExpr::getSelect(ArgVec[0], ArgVec[1],
ArgVec[2]);
+ if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
+ return Result;
+ } else if (Opcode == Instruction::ExtractElement) {
+ if (ArgVec.size() != 2)
+ error("ExtractElement instruction must have two arguments.");
+ Constant* Result = ConstantExpr::getExtractElement(ArgVec[0], ArgVec[1]);
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
return Result;
} else { // All other 2-operand expressions
More information about the llvm-commits
mailing list