UnaryInstruction(const UnaryInstruction&); // Do not implement
protected:
- UnaryInstruction(const Type *Ty, unsigned iType, Value *V, Instruction *IB = 0)
+ UnaryInstruction(const Type *Ty, unsigned iType, Value *V,
+ Instruction *IB = 0)
: Instruction(Ty, iType, &Op<0>(), 1, IB) {
Op<0>() = V;
}
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
-
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const UnaryInstruction *) { return true; }
static inline bool classof(const Instruction *I) {
: UnaryInstruction(CI.getType(), CI.getOpcode(), CI.getOperand(0)) {
}
/// @brief Do not allow default construction
- CastInst();
+ CastInst();
protected:
/// @brief Constructor with insert-before-instruction semantics for subclasses
- CastInst(const Type *Ty, unsigned iType, Value *S,
+ CastInst(const Type *Ty, unsigned iType, Value *S,
const std::string &NameStr = "", Instruction *InsertBefore = 0)
: UnaryInstruction(Ty, iType, S, InsertBefore) {
setName(NameStr);
}
/// @brief Constructor with insert-at-end-of-block semantics for subclasses
- CastInst(const Type *Ty, unsigned iType, Value *S,
+ CastInst(const Type *Ty, unsigned iType, Value *S,
const std::string &NameStr, BasicBlock *InsertAtEnd)
: UnaryInstruction(Ty, iType, S, InsertAtEnd) {
setName(NameStr);
}
public:
- /// Provides a way to construct any of the CastInst subclasses using an
+ /// Provides a way to construct any of the CastInst subclasses using an
/// opcode instead of the subclass's constructor. The opcode must be in the
/// CastOps category (Instruction::isCast(opcode) returns true). This
/// constructor has insert-before-instruction semantics to automatically
/// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
static CastInst *CreateFPCast(
- Value *S, ///< The floating point value to be casted
+ Value *S, ///< The floating point value to be casted
const Type *Ty, ///< The floating point type to cast to
const std::string &Name = "", ///< Name for the instruction
Instruction *InsertBefore = 0 ///< Place to insert the instruction
/// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
static CastInst *CreateFPCast(
- Value *S, ///< The floating point value to be casted
+ Value *S, ///< The floating point value to be casted
const Type *Ty, ///< The floating point type to cast to
const std::string &Name, ///< The name for the instruction
BasicBlock *InsertAtEnd ///< The block to insert the instruction into
bool DstIsSigned ///< Whether to treate the dest. as signed
);
- /// There are several places where we need to know if a cast instruction
+ /// There are several places where we need to know if a cast instruction
/// only deals with integer source and destination types. To simplify that
/// logic, this method is provided.
/// @returns true iff the cast has only integral typed operand and dest type.
/// A lossless cast is one that does not alter the basic value. It implies
/// a no-op cast but is more stringent, preventing things like int->float,
- /// long->double, int->ptr, or vector->anything.
+ /// long->double, int->ptr, or vector->anything.
/// @returns true iff the cast is lossless.
/// @brief Determine if this is a lossless cast.
bool isLosslessCast() const;
- /// A no-op cast is one that can be effected without changing any bits.
+ /// A no-op cast is one that can be effected without changing any bits.
/// It implies that the source and destination types are the same size. The
- /// IntPtrTy argument is used to make accurate determinations for casts
+ /// IntPtrTy argument is used to make accurate determinations for casts
/// involving Integer and Pointer types. They are no-op casts if the integer
- /// is the same size as the pointer. However, pointer size varies with
+ /// is the same size as the pointer. However, pointer size varies with
/// platform. Generally, the result of TargetData::getIntPtrType() should be
/// passed in. If that's not available, use Type::Int64Ty, which will make
/// the isNoopCast call conservative.
- /// @brief Determine if this cast is a no-op cast.
+ /// @brief Determine if this cast is a no-op cast.
bool isNoopCast(
const Type *IntPtrTy ///< Integer type corresponding to pointer
) const;
/// Determine how a pair of casts can be eliminated, if they can be at all.
/// This is a helper function for both CastInst and ConstantExpr.
/// @returns 0 if the CastInst pair can't be eliminated
- /// @returns Instruction::CastOps value for a cast that can replace
+ /// @returns Instruction::CastOps value for a cast that can replace
/// the pair, casting SrcTy to DstTy.
/// @brief Determine if a cast pair is eliminable
static unsigned isEliminableCastPair(
);
/// @brief Return the opcode of this CastInst
- Instruction::CastOps getOpcode() const {
- return Instruction::CastOps(Instruction::getOpcode());
+ Instruction::CastOps getOpcode() const {
+ return Instruction::CastOps(Instruction::getOpcode());
}
/// @brief Return the source type, as a convenience
const Type* getDestTy() const { return getType(); }
/// This method can be used to determine if a cast from S to DstTy using
- /// Opcode op is valid or not.
+ /// Opcode op is valid or not.
/// @returns true iff the proposed cast is valid.
/// @brief Determine if a cast is valid without creating one.
static bool castIsValid(Instruction::CastOps op, Value *S, const Type *DstTy);
// CmpInst Class
//===----------------------------------------------------------------------===//
-/// This class is the base class for the comparison instructions.
+/// This class is the base class for the comparison instructions.
/// @brief Abstract base class of comparison instructions.
// FIXME: why not derive from BinaryOperator?
class CmpInst: public Instruction {
CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short pred,
Value *LHS, Value *RHS, const std::string &Name = "",
Instruction *InsertBefore = 0);
-
+
CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short pred,
Value *LHS, Value *RHS, const std::string &Name,
BasicBlock *InsertAtEnd);
void *operator new(size_t s) {
return User::operator new(s, 2);
}
- /// Construct a compare instruction, given the opcode, the predicate and
- /// the two operands. Optionally (if InstBefore is specified) insert the
- /// instruction into a BasicBlock right before the specified instruction.
+ /// Construct a compare instruction, given the opcode, the predicate and
+ /// the two operands. Optionally (if InstBefore is specified) insert the
+ /// instruction into a BasicBlock right before the specified instruction.
/// The specified Instruction is allowed to be a dereferenced end iterator.
/// @brief Create a CmpInst
- static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1,
+ static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1,
Value *S2, const std::string &Name = "",
Instruction *InsertBefore = 0);
- /// Construct a compare instruction, given the opcode, the predicate and the
- /// two operands. Also automatically insert this instruction to the end of
+ /// Construct a compare instruction, given the opcode, the predicate and the
+ /// two operands. Also automatically insert this instruction to the end of
/// the BasicBlock specified.
/// @brief Create a CmpInst
- static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1,
- Value *S2, const std::string &Name,
+ static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1,
+ Value *S2, const std::string &Name,
BasicBlock *InsertAtEnd);
/// @brief Get the opcode casted to the right type
/// @brief Set the predicate for this instruction to the specified value.
void setPredicate(Predicate P) { SubclassData = P; }
-
+
/// For example, EQ -> NE, UGT -> ULE, SLT -> SGE,
/// OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
- /// @returns the inverse predicate for the instruction's current predicate.
+ /// @returns the inverse predicate for the instruction's current predicate.
/// @brief Return the inverse of the instruction's predicate.
Predicate getInversePredicate() const {
return getInversePredicate(getPredicate());
/// For example, EQ -> NE, UGT -> ULE, SLT -> SGE,
/// OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
- /// @returns the inverse predicate for predicate provided in \p pred.
+ /// @returns the inverse predicate for predicate provided in \p pred.
/// @brief Return the inverse of a given predicate
static Predicate getInversePredicate(Predicate pred);
/// For example, EQ->EQ, SLE->SGE, ULT->UGT,
/// OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
- /// @returns the predicate that would be the result of exchanging the two
- /// operands of the CmpInst instruction without changing the result
- /// produced.
+ /// @returns the predicate that would be the result of exchanging the two
+ /// operands of the CmpInst instruction without changing the result
+ /// produced.
/// @brief Return the predicate as if the operands were swapped
Predicate getSwappedPredicate() const {
return getSwappedPredicate(getPredicate());
}
- /// This is a static version that you can use without an instruction
+ /// This is a static version that you can use without an instruction
/// available.
/// @brief Return the predicate as if the operands were swapped.
static Predicate getSwappedPredicate(Predicate pred);
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const CmpInst *) { return true; }
static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::ICmp ||
+ return I->getOpcode() == Instruction::ICmp ||
I->getOpcode() == Instruction::FCmp ||
I->getOpcode() == Instruction::VICmp ||
I->getOpcode() == Instruction::VFCmp;
: AllocationInst(Ty, ArraySize, Alloca, Align, NameStr, InsertAtEnd) {}
virtual AllocaInst *clone() const;
-
+
/// isStaticAlloca - Return true if this alloca is in the entry block of the
/// function and is a constant size. If so, the code generator will fold it
/// into the prolog/epilog code, so it is basically free.
FreeInst(Value *Ptr, BasicBlock *InsertAfter);
virtual FreeInst *clone() const;
-
+
// Accessor methods for consistency with other memory operations
Value *getPointerOperand() { return getOperand(0); }
const Value *getPointerOperand() const { return getOperand(0); }
public:
LoadInst(Value *Ptr, const std::string &NameStr, Instruction *InsertBefore);
LoadInst(Value *Ptr, const std::string &NameStr, BasicBlock *InsertAtEnd);
- LoadInst(Value *Ptr, const std::string &NameStr, bool isVolatile = false,
+ LoadInst(Value *Ptr, const std::string &NameStr, bool isVolatile = false,
Instruction *InsertBefore = 0);
LoadInst(Value *Ptr, const std::string &NameStr, bool isVolatile,
unsigned Align, Instruction *InsertBefore = 0);
bool isVolatile = false, Instruction *InsertBefore = 0);
LoadInst(Value *Ptr, const char *NameStr, bool isVolatile,
BasicBlock *InsertAtEnd);
-
+
/// isVolatile - Return true if this is a load from a volatile memory
/// location.
///
/// setVolatile - Specify whether this is a volatile load or not.
///
- void setVolatile(bool V) {
- SubclassData = (SubclassData & ~1) | (V ? 1 : 0);
+ void setVolatile(bool V) {
+ SubclassData = (SubclassData & ~1) | (V ? 1 : 0);
}
virtual LoadInst *clone() const;
unsigned getAlignment() const {
return (1 << (SubclassData>>1)) >> 1;
}
-
+
void setAlignment(unsigned Align);
Value *getPointerOperand() { return getOperand(0); }
///
class StoreInst : public Instruction {
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
-
+
StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store,
&Op<0>(), 2) {
Op<0>() = SI.Op<0>();
Op<1>() = SI.Op<1>();
setVolatile(SI.isVolatile());
setAlignment(SI.getAlignment());
-
+
#ifndef NDEBUG
AssertOK();
#endif
/// setVolatile - Specify whether this is a volatile load or not.
///
- void setVolatile(bool V) {
- SubclassData = (SubclassData & ~1) | (V ? 1 : 0);
+ void setVolatile(bool V) {
+ SubclassData = (SubclassData & ~1) | (V ? 1 : 0);
}
/// Transparently provide more efficient getOperand methods.
unsigned getAlignment() const {
return (1 << (SubclassData>>1)) >> 1;
}
-
+
void setAlignment(unsigned Align);
-
+
virtual StoreInst *clone() const;
Value *getPointerOperand() { return getOperand(1); }
// do arithmetic on in constant time
std::random_access_iterator_tag) {
unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
-
+
if (NumIdx > 0) {
// This requires that the iterator points to contiguous memory.
init(Ptr, &*IdxBegin, NumIdx, NameStr); // FIXME: for the general case
///
template<typename InputIterator>
static const Type *getIndexedType(const Type *Ptr,
- InputIterator IdxBegin,
+ InputIterator IdxBegin,
InputIterator IdxEnd,
// This argument ensures that we
// have an iterator we can do
/// instruction, the second appends the new instruction to the specified
/// BasicBlock.
template<typename InputIterator>
- inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin,
+ inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin,
InputIterator IdxEnd,
unsigned Values,
const std::string &NameStr,
const std::string &NameStr, BasicBlock *InsertAtEnd);
public:
template<typename InputIterator>
- static GetElementPtrInst *Create(Value *Ptr, InputIterator IdxBegin,
+ static GetElementPtrInst *Create(Value *Ptr, InputIterator IdxBegin,
InputIterator IdxEnd,
const std::string &NameStr = "",
Instruction *InsertBefore = 0) {
- typename std::iterator_traits<InputIterator>::difference_type Values =
+ typename std::iterator_traits<InputIterator>::difference_type Values =
1 + std::distance(IdxBegin, IdxEnd);
return new(Values)
GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Values, NameStr, InsertBefore);
InputIterator IdxBegin, InputIterator IdxEnd,
const std::string &NameStr,
BasicBlock *InsertAtEnd) {
- typename std::iterator_traits<InputIterator>::difference_type Values =
+ typename std::iterator_traits<InputIterator>::difference_type Values =
1 + std::distance(IdxBegin, IdxEnd);
return new(Values)
GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Values, NameStr, InsertAtEnd);
return getIndexedType(Ptr, IdxBegin, IdxEnd,
typename std::iterator_traits<InputIterator>::
iterator_category());
- }
+ }
static const Type *getIndexedType(const Type *Ptr,
Value* const *Idx, unsigned NumIdx);
static unsigned getPointerOperandIndex() {
return 0U; // get index for modifying correct operand
}
-
+
/// getPointerOperandType - Method to return the pointer operand as a
/// PointerType.
const PointerType *getPointerOperandType() const {
return reinterpret_cast<const PointerType*>(getPointerOperand()->getType());
}
-
+
unsigned getNumIndices() const { // Note: always non-negative
return getNumOperands() - 1;
bool hasIndices() const {
return getNumOperands() > 1;
}
-
+
/// hasAllZeroIndices - Return true if all of the indices of this GEP are
/// zeros. If so, the result pointer and the first operand have the same
/// value, just potentially different types.
bool hasAllZeroIndices() const;
-
+
/// hasAllConstantIndices - Return true if all of the indices of this GEP are
/// constant integers. If so, the result pointer and the first operand have
/// a constant offset between them.
bool hasAllConstantIndices() const;
-
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const GetElementPtrInst *) { return true; }
template<typename InputIterator>
GetElementPtrInst::GetElementPtrInst(Value *Ptr,
- InputIterator IdxBegin,
+ InputIterator IdxBegin,
InputIterator IdxEnd,
unsigned Values,
const std::string &NameStr,
assert(getOperand(0)->getType() == getOperand(1)->getType() &&
"Both operands to ICmp instruction are not of the same type!");
// Check that the operands are the right type
- assert((getOperand(0)->getType()->isIntOrIntVector() ||
+ assert((getOperand(0)->getType()->isIntOrIntVector() ||
isa<PointerType>(getOperand(0)->getType())) &&
"Invalid operand types for ICmp instruction");
}
assert(getOperand(0)->getType() == getOperand(1)->getType() &&
"Both operands to ICmp instruction are not of the same type!");
// Check that the operands are the right type
- assert((getOperand(0)->getType()->isIntOrIntVector() ||
+ assert((getOperand(0)->getType()->isIntOrIntVector() ||
isa<PointerType>(getOperand(0)->getType())) &&
"Invalid operand types for ICmp instruction");
}
static bool isEquality(Predicate P) {
return P == ICMP_EQ || P == ICMP_NE;
}
-
+
/// isEquality - Return true if this predicate is either EQ or NE. This also
/// tests for commutativity.
bool isEquality() const {
/// @brief Determine if this relation is commutative.
bool isCommutative() const { return isEquality(); }
- /// isRelational - Return true if the predicate is relational (not EQ or NE).
+ /// isRelational - Return true if the predicate is relational (not EQ or NE).
///
bool isRelational() const {
return !isEquality();
}
- /// isRelational - Return true if the predicate is relational (not EQ or NE).
+ /// isRelational - Return true if the predicate is relational (not EQ or NE).
///
static bool isRelational(Predicate P) {
return !isEquality(P);
}
-
+
/// @returns true if the predicate of this ICmpInst is signed, false otherwise
/// @brief Determine if this instruction's predicate is signed.
bool isSignedPredicate() const { return isSignedPredicate(getPredicate()); }
return isTrueWhenEqual(getPredicate());
}
- /// Initialize a set of values that all satisfy the predicate with C.
+ /// Initialize a set of values that all satisfy the predicate with C.
/// @brief Make a ConstantRange for a relation with a constant value.
static ConstantRange makeConstantRange(Predicate pred, const APInt &C);
/// Exchange the two operands to this instruction in such a way that it does
/// not modify the semantics of the instruction. The predicate value may be
/// changed to retain the same result if the predicate is order dependent
- /// (e.g. ult).
+ /// (e.g. ult).
/// @brief Swap operands and adjust predicate.
void swapOperands() {
SubclassData = getSwappedPredicate();
//===----------------------------------------------------------------------===//
/// This instruction compares its operands according to the predicate given
-/// to the constructor. It only operates on floating point values or packed
+/// to the constructor. It only operates on floating point values or packed
/// vectors of floating point values. The operands must be identical types.
/// @brief Represents a floating point comparison operator.
class FCmpInst: public CmpInst {
SubclassData == FCMP_UNO;
}
- /// @returns true if the predicate is relational (not EQ or NE).
+ /// @returns true if the predicate is relational (not EQ or NE).
/// @brief Determine if this a relational predicate.
bool isRelational() const { return !isEquality(); }
/// Exchange the two operands to this instruction in such a way that it does
/// not modify the semantics of the instruction. The predicate value may be
/// changed to retain the same result if the predicate is order dependent
- /// (e.g. ult).
+ /// (e.g. ult).
/// @brief Swap operands and adjust predicate.
void swapOperands() {
SubclassData = getSwappedPredicate();
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
-
+
};
//===----------------------------------------------------------------------===//
assert(getOperand(0)->getType() == getOperand(1)->getType() &&
"Both operands to VICmp instruction are not of the same type!");
}
-
+
/// @brief Return the predicate for this instruction.
Predicate getPredicate() const { return Predicate(SubclassData); }
// do arithmetic on in constant time
std::random_access_iterator_tag) {
unsigned NumArgs = (unsigned)std::distance(ArgBegin, ArgEnd);
-
+
// This requires that the iterator points to contiguous memory.
init(Func, NumArgs ? &*ArgBegin : 0, NumArgs);
setName(NameStr);
/// Provide fast operand accessors
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
-
+
/// getCallingConv/setCallingConv - Get or set the calling convention of this
/// function call.
unsigned getCallingConv() const { return SubclassData >> 1; }
/// setAttributes - Set the parameter attributes for this call.
///
void setAttributes(const AttrListPtr &Attrs) { AttributeList = Attrs; }
-
+
/// addAttribute - adds the attribute to the list of attributes.
void addAttribute(unsigned i, Attributes attr);
else removeAttribute(~0, Attribute::NoUnwind);
}
- /// @brief Determine if the call returns a structure through first
+ /// @brief Determine if the call returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
// Be friendly and also check the callee.
return dyn_cast<Function>(getOperand(0));
}
- /// getCalledValue - Get a pointer to the function that is invoked by this
+ /// getCalledValue - Get a pointer to the function that is invoked by this
/// instruction
const Value *getCalledValue() const { return getOperand(0); }
Value *getCalledValue() { return getOperand(0); }
Instruction::Call,
OperandTraits<CallInst>::op_end(this) - (ArgEnd - ArgBegin + 1),
(unsigned)(ArgEnd - ArgBegin + 1), InsertBefore) {
- init(Func, ArgBegin, ArgEnd, NameStr,
+ init(Func, ArgBegin, ArgEnd, NameStr,
typename std::iterator_traits<InputIterator>::iterator_category());
}
Value *getCondition() const { return Op<0>(); }
Value *getTrueValue() const { return Op<1>(); }
Value *getFalseValue() const { return Op<2>(); }
-
+
/// areInvalidOperands - Return a string if the specified operands are invalid
/// for a select operation, otherwise return null.
static const char *areInvalidOperands(Value *Cond, Value *True, Value *False);
class InsertElementInst : public Instruction {
InsertElementInst(const InsertElementInst &IE);
InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
- const std::string &NameStr = "",Instruction *InsertBefore = 0);
+ const std::string &NameStr = "",
+ Instruction *InsertBefore = 0);
InsertElementInst(Value *Vec, Value *NewElt, unsigned Idx,
- const std::string &NameStr = "",Instruction *InsertBefore = 0);
+ const std::string &NameStr = "",
+ Instruction *InsertBefore = 0);
InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
const std::string &NameStr, BasicBlock *InsertAtEnd);
InsertElementInst(Value *Vec, Value *NewElt, unsigned Idx,
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
-
+
/// getMaskValue - Return the index from the shuffle mask for the specified
/// output result. This is either -1 if the element is undef or a number less
/// than 2*numelements.
// do arithmetic on in constant time
std::random_access_iterator_tag) {
unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
-
+
// There's no fundamental reason why we require at least one index
// (other than weirdness with &*IdxBegin being invalid; see
// getelementptr's init routine for example). But there's no
template<typename InputIterator>
static const Type *getIndexedType(const Type *Ptr,
- InputIterator IdxBegin,
+ InputIterator IdxBegin,
InputIterator IdxEnd,
// This argument ensures that we
// have an iterator we can do
/// an existing instruction, the second appends the new instruction to the
/// specified BasicBlock.
template<typename InputIterator>
- inline ExtractValueInst(Value *Agg, InputIterator IdxBegin,
+ inline ExtractValueInst(Value *Agg, InputIterator IdxBegin,
InputIterator IdxEnd,
const std::string &NameStr,
Instruction *InsertBefore);
public:
template<typename InputIterator>
- static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin,
+ static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin,
InputIterator IdxEnd,
const std::string &NameStr = "",
Instruction *InsertBefore = 0) {
return getIndexedType(Ptr, IdxBegin, IdxEnd,
typename std::iterator_traits<InputIterator>::
iterator_category());
- }
+ }
static const Type *getIndexedType(const Type *Ptr, unsigned Idx);
typedef const unsigned* idx_iterator;
bool hasIndices() const {
return true;
}
-
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const ExtractValueInst *) { return true; }
static inline bool classof(const Instruction *I) {
template<typename InputIterator>
ExtractValueInst::ExtractValueInst(Value *Agg,
- InputIterator IdxBegin,
+ InputIterator IdxBegin,
InputIterator IdxEnd,
const std::string &NameStr,
Instruction *InsertBefore)
// do arithmetic on in constant time
std::random_access_iterator_tag) {
unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
-
+
// There's no fundamental reason why we require at least one index
// (other than weirdness with &*IdxBegin being invalid; see
// getelementptr's init routine for example). But there's no
/// optionally insert before an existing instruction, the second appends
/// the new instruction to the specified BasicBlock.
template<typename InputIterator>
- inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin,
+ inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin,
InputIterator IdxEnd,
const std::string &NameStr,
Instruction *InsertBefore);
bool hasIndices() const {
return true;
}
-
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const InsertValueInst *) { return true; }
static inline bool classof(const Instruction *I) {
template<typename InputIterator>
InsertValueInst::InsertValueInst(Value *Agg,
Value *Val,
- InputIterator IdxBegin,
+ InputIterator IdxBegin,
InputIterator IdxEnd,
const std::string &NameStr,
Instruction *InsertBefore)
struct OperandTraits<PHINode> : HungoffOperandTraits<2> {
};
-DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value)
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value)
//===----------------------------------------------------------------------===//
/// constructor can also autoinsert before another instruction.
SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
Instruction *InsertBefore = 0);
-
+
/// SwitchInst ctor - Create a new switch instruction, specifying a value to
/// switch on and a default destination. The number of additional cases can
/// be specified here to make memory allocation more efficient. This
struct OperandTraits<SwitchInst> : HungoffOperandTraits<2> {
};
-DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)
//===----------------------------------------------------------------------===//
// do arithmetic on in constant time
std::random_access_iterator_tag) {
unsigned NumArgs = (unsigned)std::distance(ArgBegin, ArgEnd);
-
+
// This requires that the iterator points to contiguous memory.
init(Func, IfNormal, IfException, NumArgs ? &*ArgBegin : 0, NumArgs);
setName(NameStr);
/// Provide fast operand accessors
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
-
+
/// getCallingConv/setCallingConv - Get or set the calling convention of this
/// function call.
unsigned getCallingConv() const { return SubclassData; }
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(unsigned i, Attributes attr) const;
-
+
/// @brief Extract the alignment for a call or parameter (0=unknown).
unsigned getParamAlignment(unsigned i) const {
return AttributeList.getParamAlignment(i);
else removeAttribute(~0, Attribute::NoUnwind);
}
- /// @brief Determine if the call returns a structure through first
+ /// @brief Determine if the call returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
// Be friendly and also check the callee.
return dyn_cast<Function>(getOperand(0));
}
- /// getCalledValue - Get a pointer to the function that is invoked by this
+ /// getCalledValue - Get a pointer to the function that is invoked by this
/// instruction
const Value *getCalledValue() const { return getOperand(0); }
Value *getCalledValue() { return getOperand(0); }