diff options
author | Robert Bocchino <bocchino@illinois.edu> | 2006-01-10 19:05:34 +0000 |
---|---|---|
committer | Robert Bocchino <bocchino@illinois.edu> | 2006-01-10 19:05:34 +0000 |
commit | b52ee7f5ffd189c4f21ab227c6a24061ef3378fc (patch) | |
tree | 7ba7e1c62959e48f8cd1f5afdfb729cc2f0c7df7 /lib/VMCore/Instructions.cpp | |
parent | 56107e21a5cb5f2114dd1974c86f17cda47005e5 (diff) | |
download | external_llvm-b52ee7f5ffd189c4f21ab227c6a24061ef3378fc.tar.gz external_llvm-b52ee7f5ffd189c4f21ab227c6a24061ef3378fc.tar.bz2 external_llvm-b52ee7f5ffd189c4f21ab227c6a24061ef3378fc.zip |
Added support for the extractelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 1b8d0387cf..06fbcf712c 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -796,6 +796,26 @@ const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, Value *Idx) { } //===----------------------------------------------------------------------===// +// ExtractElementInst Implementation +//===----------------------------------------------------------------------===// + +ExtractElementInst::ExtractElementInst(Value *Val, Value *Index, + const std::string &Name, Instruction *InsertBef) + : Instruction(cast<PackedType>(Val->getType())->getElementType(), + ExtractElement, Ops, 2, Name, InsertBef) { + Ops[0].init(Val, this); + Ops[1].init(Index, this); +} + +ExtractElementInst::ExtractElementInst(Value *Val, Value *Index, + const std::string &Name, BasicBlock *InsertAE) + : Instruction(cast<PackedType>(Val->getType())->getElementType(), + ExtractElement, Ops, 2, Name, InsertAE) { + Ops[0].init(Val, this); + Ops[1].init(Index, this); +} + +//===----------------------------------------------------------------------===// // BinaryOperator Class //===----------------------------------------------------------------------===// @@ -1155,6 +1175,7 @@ CallInst *CallInst::clone() const { return new CallInst(*this); } ShiftInst *ShiftInst::clone() const { return new ShiftInst(*this); } SelectInst *SelectInst::clone() const { return new SelectInst(*this); } VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); } +ExtractElementInst *ExtractElementInst::clone() const {return new ExtractElementInst(*this); } PHINode *PHINode::clone() const { return new PHINode(*this); } ReturnInst *ReturnInst::clone() const { return new ReturnInst(*this); } BranchInst *BranchInst::clone() const { return new BranchInst(*this); } |