return User::operator new(s, 0);
}
void growOperands();
- void init(Value *PersFn, unsigned NumReservedValues, const Twine &NameStr);
+ void init(Function *PersFn, unsigned NumReservedValues, const Twine &NameStr);
- explicit LandingPadInst(Type *RetTy, Value *PersonalityFn,
+ explicit LandingPadInst(Type *RetTy, Function *PersonalityFn,
unsigned NumReservedValues, const Twine &NameStr,
Instruction *InsertBefore)
: Instruction(RetTy, Instruction::LandingPad, 0, 0, InsertBefore),
IsCleanup(false) {
init(PersonalityFn, 1 + NumReservedValues, NameStr);
}
- explicit LandingPadInst(Type *RetTy, Value *PersonalityFn,
+ explicit LandingPadInst(Type *RetTy, Function *PersonalityFn,
unsigned NumReservedValues, const Twine &NameStr,
BasicBlock *InsertAtEnd)
: Instruction(RetTy, Instruction::LandingPad, 0, 0, InsertAtEnd),
protected:
virtual LandingPadInst *clone_impl() const;
public:
- static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn,
+ static LandingPadInst *Create(Type *RetTy, Function *PersonalityFn,
unsigned NumReservedValues,
const Twine &NameStr = "",
Instruction *InsertBefore = 0) {
return new LandingPadInst(RetTy, PersonalityFn, NumReservedValues, NameStr,
InsertBefore);
}
- static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn,
+ static LandingPadInst *Create(Type *RetTy, Function *PersonalityFn,
unsigned NumReservedValues,
const Twine &NameStr, BasicBlock *InsertAtEnd) {
return new LandingPadInst(RetTy, PersonalityFn, NumReservedValues, NameStr,
/// getPersonalityFn - Get the personality function associated with this
/// landing pad.
- const Value *getPersonalityFn() const { return getOperand(0); }
+ const Function *getPersonalityFn() const {
+ return cast<Function>(getOperand(0));
+ }
// Simple accessors.
bool isCleanup() const { return IsCleanup; }
llvm_unreachable("SelectionDAGBuilder shouldn't visit PHI nodes!");
}
-void SelectionDAGBuilder::visitLandingPad(const LandingPadInst &) {
- // FIXME: Handle this
-}
-
void SelectionDAGBuilder::visit(unsigned Opcode, const User &I) {
// Note: this doesn't use InstVisitor, because it has to work with
// ConstantExpr's in addition to instructions.
}
void SelectionDAGBuilder::visitResume(const ResumeInst &RI) {
+ llvm_unreachable("SelectionDAGBuilder shouldn't visit resume instructions!");
+}
+
+void SelectionDAGBuilder::visitLandingPad(const LandingPadInst &) {
// FIXME: Handle this
+ assert(FuncInfo.MBB->isLandingPad() &&
+ "Call to landingpad not in landing pad!");
}
/// handleSmallSwitchCaseRange - Emit a series of specific tests (suitable for
// LandingPadInst Implementation
//===----------------------------------------------------------------------===//
-void LandingPadInst::init(Value *PersFn, unsigned NumReservedValues,
+void LandingPadInst::init(Function *PersFn, unsigned NumReservedValues,
const Twine &NameStr) {
ReservedSpace = NumReservedValues;
NumOperands = 1;
OperandList = allocHungoffUses(ReservedSpace);
- OperandList[0] = PersFn;
+ OperandList[0] = (Value*)PersFn;
setName(NameStr);
}