BasicBlock *InsertAtEnd)
: AllocationInst(Ty, ArraySize, Malloc, Name, InsertAtEnd) {}
- virtual Instruction *clone() const {
- return new MallocInst(*this);
- }
+ virtual MallocInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const MallocInst *) { return true; }
BasicBlock *InsertAtEnd)
: AllocationInst(Ty, ArraySize, Alloca, Name, InsertAtEnd) {}
- virtual Instruction *clone() const {
- return new AllocaInst(*this);
- }
+ virtual AllocaInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const AllocaInst *) { return true; }
explicit FreeInst(Value *Ptr, Instruction *InsertBefore = 0);
FreeInst(Value *Ptr, BasicBlock *InsertAfter);
- virtual Instruction *clone() const { return new FreeInst(Operands[0]); }
+ virtual FreeInst *clone() const;
virtual bool mayWriteToMemory() const { return true; }
///
void setVolatile(bool V) { Volatile = V; }
- virtual Instruction *clone() const { return new LoadInst(*this); }
+ virtual LoadInst *clone() const;
virtual bool mayWriteToMemory() const { return isVolatile(); }
///
void setVolatile(bool V) { Volatile = V; }
- virtual Instruction *clone() const { return new StoreInst(*this); }
+ virtual StoreInst *clone() const;
virtual bool mayWriteToMemory() const { return true; }
GetElementPtrInst(Value *Ptr, Value *Idx0, Value *Idx1,
const std::string &Name, BasicBlock *InsertAtEnd);
- virtual Instruction *clone() const { return new GetElementPtrInst(*this); }
+ virtual GetElementPtrInst *clone() const;
// getType - Overload to return most specific pointer type...
inline const PointerType *getType() const {
init(S);
}
- virtual Instruction *clone() const { return new CastInst(*this); }
+ virtual CastInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const CastInst *) { return true; }
explicit CallInst(Value *F, const std::string &Name,
BasicBlock *InsertAtEnd);
- virtual Instruction *clone() const { return new CallInst(*this); }
+ virtual CallInst *clone() const;
bool mayWriteToMemory() const { return true; }
// FIXME: These methods should be inline once we eliminate
return static_cast<OtherOps>(Instruction::getOpcode());
}
- virtual Instruction *clone() const { return new ShiftInst(*this); }
+ virtual ShiftInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const ShiftInst *) { return true; }
return static_cast<OtherOps>(Instruction::getOpcode());
}
- virtual Instruction *clone() const { return new SelectInst(*this); }
+ virtual SelectInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SelectInst *) { return true; }
const Type *getArgType() const { return ArgTy; }
- virtual Instruction *clone() const { return new VANextInst(*this); }
+ virtual VANextInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const VANextInst *) { return true; }
init(List);
}
- virtual Instruction *clone() const { return new VAArgInst(*this); }
+ virtual VAArgInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const VAArgInst *) { return true; }
: Instruction(Ty, Instruction::PHI, Name, InsertAtEnd) {
}
- virtual Instruction *clone() const { return new PHINode(*this); }
+ virtual PHINode *clone() const;
/// getNumIncomingValues - Return the number of incoming edges
///
: TerminatorInst(Instruction::Ret, InsertAtEnd) {
}
- virtual Instruction *clone() const { return new ReturnInst(*this); }
+ virtual ReturnInst *clone() const;
inline const Value *getReturnValue() const {
return Operands.size() ? Operands[0].get() : 0;
init(IfTrue, IfFalse, Cond);
}
- virtual Instruction *clone() const { return new BranchInst(*this); }
+ virtual BranchInst *clone() const;
inline bool isUnconditional() const { return Operands.size() == 1; }
inline bool isConditional() const { return Operands.size() == 3; }
init(Value, Default);
}
- virtual Instruction *clone() const { return new SwitchInst(*this); }
+ virtual SwitchInst *clone() const;
// Accessor Methods for Switch stmt
//
const std::vector<Value*> &Params, const std::string &Name,
BasicBlock *InsertAtEnd);
- virtual Instruction *clone() const { return new InvokeInst(*this); }
+ virtual InvokeInst *clone() const;
bool mayWriteToMemory() const { return true; }
: TerminatorInst(Instruction::Unwind, InsertAtEnd) {
}
- virtual Instruction *clone() const { return new UnwindInst(); }
+ virtual UnwindInst *clone() const;
virtual const BasicBlock *getSuccessor(unsigned idx) const {
assert(0 && "UnwindInst has no successors!");