public:
// Out of line virtual method, so the vtable, etc has a home.
virtual ~AllocationInst();
-
+
/// isArrayAllocation - Return true if there is an allocation size parameter
/// to the allocation instruction that is not 1.
///
assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
Alignment = Align;
}
-
+
virtual Instruction *clone() const = 0;
// Methods for support type inquiry through isa, cast, and dyn_cast:
MallocInst(const Type *Ty, Value *ArraySize, const std::string &Name,
BasicBlock *InsertAtEnd)
: AllocationInst(Ty, ArraySize, Malloc, 0, Name, InsertAtEnd) {}
-
- explicit MallocInst(const Type *Ty, const std::string &Name,
- Instruction *InsertBefore = 0)
+
+ MallocInst(const Type *Ty, const std::string &Name,
+ Instruction *InsertBefore = 0)
: AllocationInst(Ty, 0, Malloc, 0, Name, InsertBefore) {}
MallocInst(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
: AllocationInst(Ty, 0, Malloc, 0, Name, InsertAtEnd) {}
-
- MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
+
+ MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
const std::string &Name, BasicBlock *InsertAtEnd)
: AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertAtEnd) {}
MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
const std::string &Name = "",
Instruction *InsertBefore = 0)
: AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertBefore) {}
-
+
virtual MallocInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
: AllocationInst(Ty, 0, Alloca, 0, Name, InsertBefore) {}
AllocaInst(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
: AllocationInst(Ty, 0, Alloca, 0, Name, InsertAtEnd) {}
-
+
AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
const std::string &Name = "", Instruction *InsertBefore = 0)
: AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertBefore) {}
AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
const std::string &Name, BasicBlock *InsertAtEnd)
: AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertAtEnd) {}
-
+
virtual AllocaInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
public:
LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore);
LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd);
- LoadInst(Value *Ptr, const std::string &Name = "", bool isVolatile = false,
- Instruction *InsertBefore = 0);
+ explicit LoadInst(Value *Ptr, const std::string &Name = "",
+ bool isVolatile = false, Instruction *InsertBefore = 0);
LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
BasicBlock *InsertAtEnd);
bool isEquality() const {
return getOpcode() == SetEQ || getOpcode() == SetNE;
}
-
+
/// isRelational - Return true if this comparison is a </>/<=/>= comparison.
///
bool isRelational() const {
return !isEquality();
}
-
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SetCondInst *) { return true; }
static inline bool classof(const Instruction *I) {
/// isTruncIntCast - Return true if this is a truncating integer cast
/// instruction, e.g. a cast from long to uint.
bool isTruncIntCast() const;
-
-
+
+
virtual CastInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
BasicBlock *InsertAtEnd);
explicit CallInst(Value *F, const std::string &Name = "",
Instruction *InsertBefore = 0);
- explicit CallInst(Value *F, const std::string &Name,
- BasicBlock *InsertAtEnd);
+ CallInst(Value *F, const std::string &Name, BasicBlock *InsertAtEnd);
~CallInst();
virtual CallInst *clone() const;
/// isLogicalShift - Return true if this is a logical shift left or a logical
/// shift right.
bool isLogicalShift() const;
-
+
/// isArithmeticShift - Return true if this is a sign-extending shift right
/// operation.
bool isArithmeticShift() const {
return !isLogicalShift();
}
-
-
+
+
virtual ShiftInst *clone() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
///
class ExtractElementInst : public Instruction {
Use Ops[2];
- ExtractElementInst(const ExtractElementInst &EE) :
+ ExtractElementInst(const ExtractElementInst &EE) :
Instruction(EE.getType(), ExtractElement, Ops, 2) {
Ops[0].init(EE.Ops[0], this);
Ops[1].init(EE.Ops[1], this);
/// isValidOperands - Return true if an extractelement instruction can be
/// formed with the specified operands.
static bool isValidOperands(const Value *Vec, const Value *Idx);
-
+
virtual ExtractElementInst *clone() const;
virtual bool mayWriteToMemory() const { return false; }
/// formed with the specified operands.
static bool isValidOperands(const Value *Vec, const Value *NewElt,
const Value *Idx);
-
+
virtual InsertElementInst *clone() const;
virtual bool mayWriteToMemory() const { return false; }
inline const PackedType *getType() const {
return reinterpret_cast<const PackedType*>(Instruction::getType());
}
-
+
/// Transparently provide more efficient getOperand methods.
Value *getOperand(unsigned i) const {
assert(i < 3 && "getOperand() out of range!");
///
class ShuffleVectorInst : public Instruction {
Use Ops[3];
- ShuffleVectorInst(const ShuffleVectorInst &IE);
+ ShuffleVectorInst(const ShuffleVectorInst &IE);
public:
ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
const std::string &Name = "", Instruction *InsertBefor = 0);
ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
const std::string &Name, BasicBlock *InsertAtEnd);
-
+
/// isValidOperands - Return true if a shufflevector instruction can be
/// formed with the specified operands.
static bool isValidOperands(const Value *V1, const Value *V2,
const Value *Mask);
-
+
virtual ShuffleVectorInst *clone() const;
-
+
virtual bool mayWriteToMemory() const { return false; }
-
+
/// getType - Overload to return most specific packed type.
///
inline const PackedType *getType() const {
return reinterpret_cast<const PackedType*>(Instruction::getType());
}
-
+
/// Transparently provide more efficient getOperand methods.
Value *getOperand(unsigned i) const {
assert(i < 3 && "getOperand() out of range!");
Ops[i] = Val;
}
unsigned getNumOperands() const { return 3; }
-
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const ShuffleVectorInst *) { return true; }
static inline bool classof(const Instruction *I) {
unsigned ReservedSpace;
PHINode(const PHINode &PN);
public:
- PHINode(const Type *Ty, const std::string &Name = "",
- Instruction *InsertBefore = 0)
+ explicit PHINode(const Type *Ty, const std::string &Name = "",
+ Instruction *InsertBefore = 0)
: Instruction(Ty, Instruction::PHI, 0, 0, Name, InsertBefore),
ReservedSpace(0) {
}
return getIncomingValue(getBasicBlockIndex(BB));
}
- /// hasConstantValue - If the specified PHI node always merges together the
+ /// hasConstantValue - If the specified PHI node always merges together the
/// same value, return the value, otherwise return null.
///
Value *hasConstantValue(bool AllowNonDominatingInstruction = false) const;
-
+
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const PHINode *) { return true; }
static inline bool classof(const Instruction *I) {
//
// NOTE: If the Value* passed is of type void then the constructor behaves as
// if it was passed NULL.
- ReturnInst(Value *retVal = 0, Instruction *InsertBefore = 0)
+ explicit ReturnInst(Value *retVal = 0, Instruction *InsertBefore = 0)
: TerminatorInst(Instruction::Ret, &RetVal, 0, InsertBefore) {
init(retVal);
}
: TerminatorInst(Instruction::Ret, &RetVal, 0, InsertAtEnd) {
init(retVal);
}
- ReturnInst(BasicBlock *InsertAtEnd)
+ explicit ReturnInst(BasicBlock *InsertAtEnd)
: TerminatorInst(Instruction::Ret, &RetVal, 0, InsertAtEnd) {
}
// BranchInst(BB* T, BB *F, Value *C, Inst *I) - 'br C, T, F', insert before I
// BranchInst(BB* B, BB *I) - 'br B' insert at end
// BranchInst(BB* T, BB *F, Value *C, BB *I) - 'br C, T, F', insert at end
- BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore = 0)
+ explicit BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore = 0)
: TerminatorInst(Instruction::Br, Ops, 1, InsertBefore) {
assert(IfTrue != 0 && "Branch destination may not be null!");
Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
///
class UnwindInst : public TerminatorInst {
public:
- UnwindInst(Instruction *InsertBefore = 0)
+ explicit UnwindInst(Instruction *InsertBefore = 0)
: TerminatorInst(Instruction::Unwind, 0, 0, InsertBefore) {
}
- UnwindInst(BasicBlock *InsertAtEnd)
+ explicit UnwindInst(BasicBlock *InsertAtEnd)
: TerminatorInst(Instruction::Unwind, 0, 0, InsertAtEnd) {
}
///
class UnreachableInst : public TerminatorInst {
public:
- UnreachableInst(Instruction *InsertBefore = 0)
+ explicit UnreachableInst(Instruction *InsertBefore = 0)
: TerminatorInst(Instruction::Unreachable, 0, 0, InsertBefore) {
}
- UnreachableInst(BasicBlock *InsertAtEnd)
+ explicit UnreachableInst(BasicBlock *InsertAtEnd)
: TerminatorInst(Instruction::Unreachable, 0, 0, InsertAtEnd) {
}