VMCore support for the insertelement operation.

llvm-svn: 25408
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 06fbcf7..0bd55c9 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -800,7 +800,7 @@
 //===----------------------------------------------------------------------===//
 
 ExtractElementInst::ExtractElementInst(Value *Val, Value *Index,
-                         const std::string &Name, Instruction *InsertBef)
+                                       const std::string &Name, Instruction *InsertBef)
   : Instruction(cast<PackedType>(Val->getType())->getElementType(),
                 ExtractElement, Ops, 2, Name, InsertBef) {
   Ops[0].init(Val, this);
@@ -808,7 +808,7 @@
 }
 
 ExtractElementInst::ExtractElementInst(Value *Val, Value *Index,
-                         const std::string &Name, BasicBlock *InsertAE)
+                                       const std::string &Name, BasicBlock *InsertAE)
   : Instruction(cast<PackedType>(Val->getType())->getElementType(),
                 ExtractElement, Ops, 2, Name, InsertAE) {
   Ops[0].init(Val, this);
@@ -816,6 +816,26 @@
 }
 
 //===----------------------------------------------------------------------===//
+//                           InsertElementInst Implementation
+//===----------------------------------------------------------------------===//
+
+InsertElementInst::InsertElementInst(Value *Val, Value *Elt, Value *Index,
+                                     const std::string &Name, Instruction *InsertBef)
+  : Instruction(Val->getType(), InsertElement, Ops, 3, Name, InsertBef) {
+  Ops[0].init(Val, this);
+  Ops[1].init(Elt, this);
+  Ops[2].init(Index, this);
+}
+
+InsertElementInst::InsertElementInst(Value *Val, Value *Elt, Value *Index,
+                                     const std::string &Name, BasicBlock *InsertAE)
+  : Instruction(Val->getType(), InsertElement, Ops, 3, Name, InsertAE) {
+  Ops[0].init(Val, this);
+  Ops[1].init(Elt, this);
+  Ops[2].init(Index, this);
+}
+
+//===----------------------------------------------------------------------===//
 //                             BinaryOperator Class
 //===----------------------------------------------------------------------===//
 
@@ -1176,6 +1196,7 @@
 SelectInst *SelectInst::clone() const { return new SelectInst(*this); }
 VAArgInst  *VAArgInst::clone()  const { return new VAArgInst(*this); }
 ExtractElementInst *ExtractElementInst::clone() const {return new ExtractElementInst(*this); }
+InsertElementInst *InsertElementInst::clone() const {return new InsertElementInst(*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); }