summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-07-30 05:42:50 +0000
committerBill Wendling <isanbard@gmail.com>2011-07-30 05:42:50 +0000
commit10c6d12a9fd4dab411091f64db4db69670b88850 (patch)
tree629a8bff765bcf0baa378c7367ab1d903f3910fc /lib/VMCore/Instructions.cpp
parentefd7919618d59bd0e3fcf861cc0d1eacbbed0ac6 (diff)
downloadexternal_llvm-10c6d12a9fd4dab411091f64db4db69670b88850.zip
external_llvm-10c6d12a9fd4dab411091f64db4db69670b88850.tar.gz
external_llvm-10c6d12a9fd4dab411091f64db4db69670b88850.tar.bz2
Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136556 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp122
1 files changed, 2 insertions, 120 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index abee7b7..75458ba 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -166,77 +166,6 @@ Value *PHINode::hasConstantValue() const {
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 @@ void InvokeInst::removeAttribute(unsigned i, Attributes attr) {
setAttributes(PAL);
}
-LandingPadInst *InvokeInst::getLandingPad() const {
- return cast<LandingPadInst>(getUnwindDest()->getFirstNonPHI());
-}
//===----------------------------------------------------------------------===//
// ReturnInst Implementation
@@ -648,42 +574,6 @@ BasicBlock *UnwindInst::getSuccessorV(unsigned idx) const {
}
//===----------------------------------------------------------------------===//
-// 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 @@ unsigned UnreachableInst::getNumSuccessorsV() const {
}
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 @@ PHINode *PHINode::clone_impl() const {
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 @@ InvokeInst *InvokeInst::clone_impl() const {
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);