From ed2c45387b1f7dc33bf7bcbe7f8adb8beda2d0d4 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Mon, 9 Feb 2009 17:11:05 +0000 Subject: [PATCH] 80-column violations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64147 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/InstrTypes.h | 73 +++++++++---------- include/llvm/Instructions.h | 138 ++++++++++++++++++------------------ 2 files changed, 107 insertions(+), 104 deletions(-) diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 23aca6ab134..3a774d45e92 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -90,7 +90,8 @@ class UnaryInstruction : public Instruction { 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; } @@ -109,7 +110,7 @@ public: /// 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) { @@ -266,22 +267,22 @@ class CastInst : public UnaryInstruction { : 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 @@ -376,7 +377,7 @@ public: /// @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 @@ -384,7 +385,7 @@ public: /// @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 @@ -422,7 +423,7 @@ public: 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. @@ -431,20 +432,20 @@ public: /// 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; @@ -452,7 +453,7 @@ public: /// 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( @@ -465,8 +466,8 @@ public: ); /// @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 @@ -475,7 +476,7 @@ public: 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); @@ -494,7 +495,7 @@ public: // 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 { @@ -504,7 +505,7 @@ protected: 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); @@ -554,21 +555,21 @@ public: 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 @@ -581,10 +582,10 @@ public: /// @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()); @@ -592,21 +593,21 @@ public: /// 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); @@ -644,7 +645,7 @@ public: /// @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; diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index d8ce835d790..9503d8a5437 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -164,7 +164,7 @@ public: : 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. @@ -194,7 +194,7 @@ public: 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); } @@ -232,7 +232,7 @@ class LoadInst : public UnaryInstruction { 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); @@ -247,7 +247,7 @@ public: 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. /// @@ -255,8 +255,8 @@ public: /// 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; @@ -266,7 +266,7 @@ public: unsigned getAlignment() const { return (1 << (SubclassData>>1)) >> 1; } - + void setAlignment(unsigned Align); Value *getPointerOperand() { return getOperand(0); } @@ -292,14 +292,14 @@ public: /// 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 @@ -328,8 +328,8 @@ public: /// 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. @@ -340,9 +340,9 @@ public: unsigned getAlignment() const { return (1 << (SubclassData>>1)) >> 1; } - + void setAlignment(unsigned Align); - + virtual StoreInst *clone() const; Value *getPointerOperand() { return getOperand(1); } @@ -393,7 +393,7 @@ class GetElementPtrInst : public Instruction { // do arithmetic on in constant time std::random_access_iterator_tag) { unsigned NumIdx = static_cast(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 @@ -412,7 +412,7 @@ class GetElementPtrInst : public Instruction { /// template static const Type *getIndexedType(const Type *Ptr, - InputIterator IdxBegin, + InputIterator IdxBegin, InputIterator IdxEnd, // This argument ensures that we // have an iterator we can do @@ -432,7 +432,7 @@ class GetElementPtrInst : public Instruction { /// instruction, the second appends the new instruction to the specified /// BasicBlock. template - inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, + inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, unsigned Values, const std::string &NameStr, @@ -451,11 +451,11 @@ class GetElementPtrInst : public Instruction { const std::string &NameStr, BasicBlock *InsertAtEnd); public: template - 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::difference_type Values = + typename std::iterator_traits::difference_type Values = 1 + std::distance(IdxBegin, IdxEnd); return new(Values) GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Values, NameStr, InsertBefore); @@ -465,7 +465,7 @@ public: InputIterator IdxBegin, InputIterator IdxEnd, const std::string &NameStr, BasicBlock *InsertAtEnd) { - typename std::iterator_traits::difference_type Values = + typename std::iterator_traits::difference_type Values = 1 + std::distance(IdxBegin, IdxEnd); return new(Values) GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Values, NameStr, InsertAtEnd); @@ -507,7 +507,7 @@ public: return getIndexedType(Ptr, IdxBegin, IdxEnd, typename std::iterator_traits:: iterator_category()); - } + } static const Type *getIndexedType(const Type *Ptr, Value* const *Idx, unsigned NumIdx); @@ -531,13 +531,13 @@ public: 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(getPointerOperand()->getType()); } - + unsigned getNumIndices() const { // Note: always non-negative return getNumOperands() - 1; @@ -546,17 +546,17 @@ public: 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; } @@ -574,7 +574,7 @@ struct OperandTraits : VariadicOperandTraits<1> { template GetElementPtrInst::GetElementPtrInst(Value *Ptr, - InputIterator IdxBegin, + InputIterator IdxBegin, InputIterator IdxEnd, unsigned Values, const std::string &NameStr, @@ -639,7 +639,7 @@ public: 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(getOperand(0)->getType())) && "Invalid operand types for ICmp instruction"); } @@ -660,7 +660,7 @@ public: 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(getOperand(0)->getType())) && "Invalid operand types for ICmp instruction"); } @@ -694,7 +694,7 @@ public: 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 { @@ -705,18 +705,18 @@ public: /// @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()); } @@ -741,14 +741,14 @@ public: 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(); @@ -773,7 +773,7 @@ public: //===----------------------------------------------------------------------===// /// 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 { @@ -833,14 +833,14 @@ public: 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(); @@ -857,7 +857,7 @@ public: static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); } - + }; //===----------------------------------------------------------------------===// @@ -901,7 +901,7 @@ public: 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); } @@ -996,7 +996,7 @@ class CallInst : public Instruction { // 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); @@ -1074,7 +1074,7 @@ public: /// 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; } @@ -1089,7 +1089,7 @@ public: /// 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); @@ -1140,7 +1140,7 @@ public: 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. @@ -1159,7 +1159,7 @@ public: return dyn_cast(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); } @@ -1198,7 +1198,7 @@ CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, Instruction::Call, OperandTraits::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::iterator_category()); } @@ -1251,7 +1251,7 @@ public: 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); @@ -1378,9 +1378,11 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractElementInst, Value) 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, @@ -1477,7 +1479,7 @@ public: /// 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. @@ -1521,7 +1523,7 @@ class ExtractValueInst : public UnaryInstruction { // do arithmetic on in constant time std::random_access_iterator_tag) { unsigned NumIdx = static_cast(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 @@ -1544,7 +1546,7 @@ class ExtractValueInst : public UnaryInstruction { template static const Type *getIndexedType(const Type *Ptr, - InputIterator IdxBegin, + InputIterator IdxBegin, InputIterator IdxEnd, // This argument ensures that we // have an iterator we can do @@ -1564,7 +1566,7 @@ class ExtractValueInst : public UnaryInstruction { /// an existing instruction, the second appends the new instruction to the /// specified BasicBlock. template - inline ExtractValueInst(Value *Agg, InputIterator IdxBegin, + inline ExtractValueInst(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &NameStr, Instruction *InsertBefore); @@ -1580,7 +1582,7 @@ class ExtractValueInst : public UnaryInstruction { public: template - static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin, + static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &NameStr = "", Instruction *InsertBefore = 0) { @@ -1631,7 +1633,7 @@ public: return getIndexedType(Ptr, IdxBegin, IdxEnd, typename std::iterator_traits:: iterator_category()); - } + } static const Type *getIndexedType(const Type *Ptr, unsigned Idx); typedef const unsigned* idx_iterator; @@ -1655,7 +1657,7 @@ public: 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) { @@ -1668,7 +1670,7 @@ public: template ExtractValueInst::ExtractValueInst(Value *Agg, - InputIterator IdxBegin, + InputIterator IdxBegin, InputIterator IdxEnd, const std::string &NameStr, Instruction *InsertBefore) @@ -1716,7 +1718,7 @@ class InsertValueInst : public Instruction { // do arithmetic on in constant time std::random_access_iterator_tag) { unsigned NumIdx = static_cast(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 @@ -1733,7 +1735,7 @@ class InsertValueInst : public Instruction { /// optionally insert before an existing instruction, the second appends /// the new instruction to the specified BasicBlock. template - inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin, + inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &NameStr, Instruction *InsertBefore); @@ -1827,7 +1829,7 @@ public: 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) { @@ -1845,7 +1847,7 @@ struct OperandTraits : FixedNumOperandTraits<2> { template InsertValueInst::InsertValueInst(Value *Agg, Value *Val, - InputIterator IdxBegin, + InputIterator IdxBegin, InputIterator IdxEnd, const std::string &NameStr, Instruction *InsertBefore) @@ -2030,7 +2032,7 @@ template <> struct OperandTraits : HungoffOperandTraits<2> { }; -DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value) +DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value) //===----------------------------------------------------------------------===// @@ -2246,7 +2248,7 @@ class SwitchInst : public TerminatorInst { /// 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 @@ -2367,7 +2369,7 @@ template <> struct OperandTraits : HungoffOperandTraits<2> { }; -DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value) +DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value) //===----------------------------------------------------------------------===// @@ -2391,7 +2393,7 @@ class InvokeInst : public TerminatorInst { // 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); @@ -2448,7 +2450,7 @@ public: /// 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; } @@ -2472,7 +2474,7 @@ public: /// @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); @@ -2514,7 +2516,7 @@ public: 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. @@ -2533,7 +2535,7 @@ public: return dyn_cast(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); }