//===----------------------------------------------------------------------===//
class CatchEndPadInst : public TerminatorInst {
+private:
CatchEndPadInst(const CatchEndPadInst &RI);
-private:
void init(BasicBlock *UnwindBB);
CatchEndPadInst(LLVMContext &C, BasicBlock *UnwindBB, unsigned Values,
Instruction *InsertBefore = nullptr);
unsigned getNumSuccessorsV() const override;
void setSuccessorV(unsigned Idx, BasicBlock *B) override;
-private:
// Shadow Instruction::setInstructionSubclassData with a private forwarding
// method so that subclasses cannot accidentally use it.
void setInstructionSubclassData(unsigned short D) {
class CatchReturnInst : public TerminatorInst {
CatchReturnInst(const CatchReturnInst &RI);
-private:
void init(CatchPadInst *CatchPad, BasicBlock *BB);
CatchReturnInst(CatchPadInst *CatchPad, BasicBlock *BB,
- Instruction *InsertBefore = nullptr);
+ Instruction *InsertBefore);
CatchReturnInst(CatchPadInst *CatchPad, BasicBlock *BB,
BasicBlock *InsertAtEnd);
//===----------------------------------------------------------------------===//
class CleanupReturnInst : public TerminatorInst {
+private:
CleanupReturnInst(const CleanupReturnInst &RI);
-private:
void init(CleanupPadInst *CleanupPad, BasicBlock *UnwindBB);
CleanupReturnInst(CleanupPadInst *CleanupPad, BasicBlock *UnwindBB,
unsigned Values, Instruction *InsertBefore = nullptr);
CleanupReturnInst(CleanupPadInst *CleanupPad, BasicBlock *UnwindBB,
unsigned Values, BasicBlock *InsertAtEnd);
- int getUnwindLabelOpIdx() const {
- assert(hasUnwindDest());
- return 0;
- }
-
protected:
// Note: Instruction needs to be a friend here to call cloneImpl.
friend class Instruction;
OperandTraits<CleanupReturnInst>::op_end(this) -
CRI.getNumOperands(),
CRI.getNumOperands()) {
- SubclassOptionalData = CRI.SubclassOptionalData;
setInstructionSubclassData(CRI.getSubclassDataFromInstruction());
Op<-1>() = CRI.Op<-1>();
if (CRI.hasUnwindDest())
}
void CleanupReturnInst::init(CleanupPadInst *CleanupPad, BasicBlock *UnwindBB) {
- SubclassOptionalData = 0;
if (UnwindBB)
setInstructionSubclassData(getSubclassDataFromInstruction() | 1);
OperandTraits<CatchEndPadInst>::op_end(this) -
CRI.getNumOperands(),
CRI.getNumOperands()) {
- SubclassOptionalData = CRI.SubclassOptionalData;
setInstructionSubclassData(CRI.getSubclassDataFromInstruction());
if (BasicBlock *UnwindDest = CRI.getUnwindDest())
setUnwindDest(UnwindDest);
}
void CatchEndPadInst::init(BasicBlock *UnwindBB) {
- SubclassOptionalData = 0;
if (UnwindBB) {
setInstructionSubclassData(getSubclassDataFromInstruction() | 1);
setUnwindDest(UnwindBB);
}
BasicBlock *CatchReturnInst::getSuccessorV(unsigned Idx) const {
- assert(Idx == 0);
+ assert(Idx < getNumSuccessors() && "Successor # out of range for catchret!");
return getSuccessor();
}
unsigned CatchReturnInst::getNumSuccessorsV() const {
return getNumSuccessors();
}
void CatchReturnInst::setSuccessorV(unsigned Idx, BasicBlock *B) {
- assert(Idx == 0);
+ assert(Idx < getNumSuccessors() && "Successor # out of range for catchret!");
setSuccessor(B);
}
// TerminatePadInst Implementation
//===----------------------------------------------------------------------===//
void TerminatePadInst::init(BasicBlock *BB, ArrayRef<Value *> Args) {
- SubclassOptionalData = 0;
if (BB)
setInstructionSubclassData(getSubclassDataFromInstruction() | 1);
if (BB)
OperandTraits<TerminatePadInst>::op_end(this) -
TPI.getNumOperands(),
TPI.getNumOperands()) {
- SubclassOptionalData = TPI.SubclassOptionalData;
setInstructionSubclassData(TPI.getSubclassDataFromInstruction());
std::copy(TPI.op_begin(), TPI.op_end(), op_begin());
}