Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444,
r136445, r136446, r136253 pending review.

llvm-svn: 136556
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index abee7b7..75458ba 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -166,77 +166,6 @@
   return ConstantValue;
 }
 
-//===----------------------------------------------------------------------===//
-//                       LandingPadInst Implementation
-//===----------------------------------------------------------------------===//
-
-void LandingPadInst::init(Function *PersFn, unsigned NumReservedValues,
-                          const Twine &NameStr) {
-  ReservedSpace = NumReservedValues;
-  NumOperands = 1;
-  OperandList = allocHungoffUses(ReservedSpace);
-  OperandList[0] = (Value*)PersFn;
-  setName(NameStr);
-}
-
-LandingPadInst::LandingPadInst(const LandingPadInst &LP)
-  : Instruction(LP.getType(), Instruction::LandingPad,
-                allocHungoffUses(LP.getNumOperands()), LP.getNumOperands()),
-    ReservedSpace(LP.getNumOperands()) {
-  Use *OL = OperandList, *InOL = LP.OperandList;
-  for (unsigned I = 0, E = ReservedSpace; I != E; ++I)
-    OL[I] = InOL[I];
-
-  for (SmallVectorImpl<ClauseType>::const_iterator
-         I = LP.ClauseIdxs.begin(), E = LP.ClauseIdxs.end(); I != E; ++I)
-    ClauseIdxs.push_back(*I);
-
-  IsCleanup = LP.IsCleanup;
-  SubclassOptionalData = LP.SubclassOptionalData;
-}
-
-LandingPadInst::~LandingPadInst() {
-  dropHungoffUses();
-}
-
-/// growOperands - grow operands - This grows the operand list in response to a
-/// push_back style of operation. This grows the number of ops by 2 times.
-void LandingPadInst::growOperands() {
-  unsigned e = getNumOperands();
-  ReservedSpace = e * 2;
-
-  Use *NewOps = allocHungoffUses(ReservedSpace);
-  Use *OldOps = OperandList;
-  for (unsigned i = 0; i != e; ++i)
-      NewOps[i] = OldOps[i];
-
-  OperandList = NewOps;
-  Use::zap(OldOps, OldOps + e, true);
-}
-
-void LandingPadInst::reserveClauses(unsigned Size) {
-  unsigned e = getNumOperands();
-  if (ReservedSpace >= e + Size) return;
-  ReservedSpace = e + Size;
-
-  Use *NewOps = allocHungoffUses(ReservedSpace);
-  Use *OldOps = OperandList;
-  for (unsigned i = 0; i != e; ++i)
-      NewOps[i] = OldOps[i];
-
-  OperandList = NewOps;
-  Use::zap(OldOps, OldOps + e, true);
-}
-
-void LandingPadInst::addClause(ClauseType CT, Constant *ClauseVal) {
-  unsigned OpNo = getNumOperands();
-  if (OpNo + 1 > ReservedSpace)
-    growOperands();
-  assert(OpNo < ReservedSpace && "Growing didn't work!");
-  ClauseIdxs.push_back(CT);
-  ++NumOperands;
-  OperandList[OpNo] = (Value*)ClauseVal;
-}
 
 //===----------------------------------------------------------------------===//
 //                        CallInst Implementation
@@ -565,9 +494,6 @@
   setAttributes(PAL);
 }
 
-LandingPadInst *InvokeInst::getLandingPad() const {
-  return cast<LandingPadInst>(getUnwindDest()->getFirstNonPHI());
-}
 
 //===----------------------------------------------------------------------===//
 //                        ReturnInst Implementation
@@ -648,42 +574,6 @@
 }
 
 //===----------------------------------------------------------------------===//
-//                        ResumeInst Implementation
-//===----------------------------------------------------------------------===//
-
-ResumeInst::ResumeInst(const ResumeInst &RI)
-  : TerminatorInst(Type::getVoidTy(RI.getContext()), Instruction::Resume,
-                   OperandTraits<ResumeInst>::op_begin(this), 1) {
-  Op<0>() = RI.Op<0>();
-  SubclassOptionalData = RI.SubclassOptionalData;
-}
-
-ResumeInst::ResumeInst(LLVMContext &C, Value *Exn, Instruction *InsertBefore)
-  : TerminatorInst(Type::getVoidTy(C), Instruction::Resume,
-                   OperandTraits<ResumeInst>::op_begin(this), 1, InsertBefore) {
-  Op<0>() = Exn;
-}
-
-ResumeInst::ResumeInst(LLVMContext &C, Value *Exn, BasicBlock *InsertAtEnd)
-  : TerminatorInst(Type::getVoidTy(C), Instruction::Resume,
-                   OperandTraits<ResumeInst>::op_begin(this), 1, InsertAtEnd) {
-  Op<0>() = Exn;
-}
-
-unsigned ResumeInst::getNumSuccessorsV() const {
-  return getNumSuccessors();
-}
-
-void ResumeInst::setSuccessorV(unsigned idx, BasicBlock *NewSucc) {
-  llvm_unreachable("ResumeInst has no successors!");
-}
-
-BasicBlock *ResumeInst::getSuccessorV(unsigned idx) const {
-  llvm_unreachable("ResumeInst has no successors!");
-  return 0;
-}
-
-//===----------------------------------------------------------------------===//
 //                      UnreachableInst Implementation
 //===----------------------------------------------------------------------===//
 
@@ -702,11 +592,11 @@
 }
 
 void UnreachableInst::setSuccessorV(unsigned idx, BasicBlock *NewSucc) {
-  llvm_unreachable("UnreachableInst has no successors!");
+  llvm_unreachable("UnwindInst has no successors!");
 }
 
 BasicBlock *UnreachableInst::getSuccessorV(unsigned idx) const {
-  llvm_unreachable("UnreachableInst has no successors!");
+  llvm_unreachable("UnwindInst has no successors!");
   return 0;
 }
 
@@ -3343,10 +3233,6 @@
   return new PHINode(*this);
 }
 
-LandingPadInst *LandingPadInst::clone_impl() const {
-  return new LandingPadInst(*this);
-}
-
 ReturnInst *ReturnInst::clone_impl() const {
   return new(getNumOperands()) ReturnInst(*this);
 }
@@ -3368,10 +3254,6 @@
   return new(getNumOperands()) InvokeInst(*this);
 }
 
-ResumeInst *ResumeInst::clone_impl() const {
-  return new(1) ResumeInst(*this);
-}
-
 UnwindInst *UnwindInst::clone_impl() const {
   LLVMContext &Context = getContext();
   return new UnwindInst(Context);