diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Argument.h | 3 | ||||
-rw-r--r-- | include/llvm/BasicBlock.h | 6 | ||||
-rw-r--r-- | include/llvm/Function.h | 4 | ||||
-rw-r--r-- | include/llvm/GlobalValue.h | 4 | ||||
-rw-r--r-- | include/llvm/GlobalVariable.h | 4 | ||||
-rw-r--r-- | include/llvm/InstrTypes.h | 68 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 258 | ||||
-rw-r--r-- | include/llvm/Value.h | 5 |
8 files changed, 175 insertions, 177 deletions
diff --git a/include/llvm/Argument.h b/include/llvm/Argument.h index 9c06367798..3a846c2899 100644 --- a/include/llvm/Argument.h +++ b/include/llvm/Argument.h @@ -38,8 +38,7 @@ public: /// Argument ctor - If Function argument is specified, this argument is /// inserted at the end of the argument list for the function. /// - explicit Argument(const Type *Ty, const std::string &Name = "", - Function *F = 0); + explicit Argument(const Type *Ty, const Twine &Name = "", Function *F = 0); inline const Function *getParent() const { return Parent; } inline Function *getParent() { return Parent; } diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index a20309fa84..eabc1a0d2b 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -83,7 +83,7 @@ private: /// is automatically inserted at either the end of the function (if /// InsertBefore is null), or before the specified basic block. /// - explicit BasicBlock(const std::string &Name = "", Function *Parent = 0, + explicit BasicBlock(const Twine &Name = "", Function *Parent = 0, BasicBlock *InsertBefore = 0); public: /// getContext - Get the context in which this basic block lives, @@ -97,7 +97,7 @@ public: /// Create - Creates a new BasicBlock. If the Parent parameter is specified, /// the basic block is automatically inserted at either the end of the /// function (if InsertBefore is 0), or before the specified basic block. - static BasicBlock *Create(const std::string &Name = "", Function *Parent = 0, + static BasicBlock *Create(const Twine &Name = "", Function *Parent = 0, BasicBlock *InsertBefore = 0) { return new BasicBlock(Name, Parent, InsertBefore); } @@ -232,7 +232,7 @@ public: /// cause a degenerate basic block to be formed, having a terminator inside of /// the basic block). /// - BasicBlock *splitBasicBlock(iterator I, const std::string &BBName = ""); + BasicBlock *splitBasicBlock(iterator I, const Twine &BBName = ""); }; } // End llvm namespace diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 3bf65ff475..57ebfb10a5 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -114,11 +114,11 @@ private: /// the module. /// Function(const FunctionType *Ty, LinkageTypes Linkage, - const std::string &N = "", Module *M = 0); + const Twine &N = "", Module *M = 0); public: static Function *Create(const FunctionType *Ty, LinkageTypes Linkage, - const std::string &N = "", Module *M = 0) { + const Twine &N = "", Module *M = 0) { return new(0) Function(Ty, Linkage, N, M); } diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index b897f9f6bb..d53d49bfec 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -56,10 +56,10 @@ public: protected: GlobalValue(const Type *ty, ValueTy vty, Use *Ops, unsigned NumOps, - LinkageTypes linkage, const std::string &name = "") + LinkageTypes linkage, const Twine &Name = "") : Constant(ty, vty, Ops, NumOps), Parent(0), Linkage(linkage), Visibility(DefaultVisibility), Alignment(0) { - if (!name.empty()) setName(name); + setName(Name); } Module *Parent; diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h index 28eaa624e9..f18554d53b 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -52,13 +52,13 @@ public: /// automatically inserted into the end of the specified modules global list. GlobalVariable(LLVMContext &Context, const Type *Ty, bool isConstant, LinkageTypes Linkage, - Constant *Initializer = 0, const std::string &Name = "", + Constant *Initializer = 0, const Twine &Name = "", bool ThreadLocal = false, unsigned AddressSpace = 0); /// GlobalVariable ctor - This creates a global and inserts it before the /// specified other global. GlobalVariable(Module &M, const Type *Ty, bool isConstant, LinkageTypes Linkage, Constant *Initializer, - const std::string &Name, + const Twine &Name, GlobalVariable *InsertBefore = 0, bool ThreadLocal = false, unsigned AddressSpace = 0); diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index c3c48af53f..43fe664003 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -144,9 +144,9 @@ class BinaryOperator : public Instruction { protected: void init(BinaryOps iType); BinaryOperator(BinaryOps iType, Value *S1, Value *S2, const Type *Ty, - const std::string &Name, Instruction *InsertBefore); + const Twine &Name, Instruction *InsertBefore); BinaryOperator(BinaryOps iType, Value *S1, Value *S2, const Type *Ty, - const std::string &Name, BasicBlock *InsertAtEnd); + const Twine &Name, BasicBlock *InsertAtEnd); public: // allocate space for exactly two operands void *operator new(size_t s) { @@ -162,7 +162,7 @@ public: /// Instruction is allowed to be a dereferenced end iterator. /// static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2, - const std::string &Name = "", + const Twine &Name = "", Instruction *InsertBefore = 0); /// Create() - Construct a binary instruction, given the opcode and the two @@ -170,27 +170,26 @@ public: /// BasicBlock specified. /// static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2, - const std::string &Name, - BasicBlock *InsertAtEnd); + const Twine &Name, BasicBlock *InsertAtEnd); /// Create* - These methods just forward to Create, and are useful when you /// statically know what type of instruction you're going to create. These /// helpers just save some typing. #define HANDLE_BINARY_INST(N, OPC, CLASS) \ static BinaryOperator *Create##OPC(Value *V1, Value *V2, \ - const std::string &Name = "") {\ + const Twine &Name = "") {\ return Create(Instruction::OPC, V1, V2, Name);\ } #include "llvm/Instruction.def" #define HANDLE_BINARY_INST(N, OPC, CLASS) \ static BinaryOperator *Create##OPC(Value *V1, Value *V2, \ - const std::string &Name, BasicBlock *BB) {\ + const Twine &Name, BasicBlock *BB) {\ return Create(Instruction::OPC, V1, V2, Name, BB);\ } #include "llvm/Instruction.def" #define HANDLE_BINARY_INST(N, OPC, CLASS) \ static BinaryOperator *Create##OPC(Value *V1, Value *V2, \ - const std::string &Name, Instruction *I) {\ + const Twine &Name, Instruction *I) {\ return Create(Instruction::OPC, V1, V2, Name, I);\ } #include "llvm/Instruction.def" @@ -203,22 +202,22 @@ public: /// instructions out of SUB and XOR instructions. /// static BinaryOperator *CreateNeg(LLVMContext &Context, - Value *Op, const std::string &Name = "", + Value *Op, const Twine &Name = "", Instruction *InsertBefore = 0); static BinaryOperator *CreateNeg(LLVMContext &Context, - Value *Op, const std::string &Name, + Value *Op, const Twine &Name, BasicBlock *InsertAtEnd); static BinaryOperator *CreateFNeg(LLVMContext &Context, - Value *Op, const std::string &Name = "", + Value *Op, const Twine &Name = "", Instruction *InsertBefore = 0); static BinaryOperator *CreateFNeg(LLVMContext &Context, - Value *Op, const std::string &Name, + Value *Op, const Twine &Name, BasicBlock *InsertAtEnd); static BinaryOperator *CreateNot(LLVMContext &Context, - Value *Op, const std::string &Name = "", + Value *Op, const Twine &Name = "", Instruction *InsertBefore = 0); static BinaryOperator *CreateNot(LLVMContext &Context, - Value *Op, const std::string &Name, + Value *Op, const Twine &Name, BasicBlock *InsertAtEnd); /// isNeg, isFNeg, isNot - Check if the given Value is a @@ -288,13 +287,13 @@ class CastInst : public UnaryInstruction { protected: /// @brief Constructor with insert-before-instruction semantics for subclasses CastInst(const Type *Ty, unsigned iType, Value *S, - const std::string &NameStr = "", Instruction *InsertBefore = 0) + const Twine &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, - const std::string &NameStr, BasicBlock *InsertAtEnd) + const Twine &NameStr, BasicBlock *InsertAtEnd) : UnaryInstruction(Ty, iType, S, InsertAtEnd) { setName(NameStr); } @@ -309,7 +308,7 @@ public: Instruction::CastOps, ///< The opcode of the cast instruction Value *S, ///< The value to be casted (operand 0) const Type *Ty, ///< The type to which cast should be made - const std::string &Name = "", ///< Name for the instruction + const Twine &Name = "", ///< Name for the instruction Instruction *InsertBefore = 0 ///< Place to insert the instruction ); /// Provides a way to construct any of the CastInst subclasses using an @@ -322,7 +321,7 @@ public: Instruction::CastOps, ///< The opcode for the cast instruction Value *S, ///< The value to be casted (operand 0) const Type *Ty, ///< The type to which operand is casted - const std::string &Name, ///< The name for the instruction + const Twine &Name, ///< The name for the instruction BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); @@ -330,7 +329,7 @@ public: static CastInst *CreateZExtOrBitCast( Value *S, ///< The value to be casted (operand 0) const Type *Ty, ///< The type to which cast should be made - const std::string &Name = "", ///< Name for the instruction + const Twine &Name = "", ///< Name for the instruction Instruction *InsertBefore = 0 ///< Place to insert the instruction ); @@ -338,7 +337,7 @@ public: static CastInst *CreateZExtOrBitCast( Value *S, ///< The value to be casted (operand 0) const Type *Ty, ///< The type to which operand is casted - const std::string &Name, ///< The name for the instruction + const Twine &Name, ///< The name for the instruction BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); @@ -346,7 +345,7 @@ public: static CastInst *CreateSExtOrBitCast( Value *S, ///< The value to be casted (operand 0) const Type *Ty, ///< The type to which cast should be made - const std::string &Name = "", ///< Name for the instruction + const Twine &Name = "", ///< Name for the instruction Instruction *InsertBefore = 0 ///< Place to insert the instruction ); @@ -354,7 +353,7 @@ public: static CastInst *CreateSExtOrBitCast( Value *S, ///< The value to be casted (operand 0) const Type *Ty, ///< The type to which operand is casted - const std::string &Name, ///< The name for the instruction + const Twine &Name, ///< The name for the instruction BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); @@ -362,7 +361,7 @@ public: static CastInst *CreatePointerCast( Value *S, ///< The pointer value to be casted (operand 0) const Type *Ty, ///< The type to which operand is casted - const std::string &Name, ///< The name for the instruction + const Twine &Name, ///< The name for the instruction BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); @@ -370,7 +369,7 @@ public: static CastInst *CreatePointerCast( Value *S, ///< The pointer value to be casted (operand 0) const Type *Ty, ///< The type to which cast should be made - const std::string &Name = "", ///< Name for the instruction + const Twine &Name = "", ///< Name for the instruction Instruction *InsertBefore = 0 ///< Place to insert the instruction ); @@ -379,7 +378,7 @@ public: Value *S, ///< The pointer value to be casted (operand 0) const Type *Ty, ///< The type to which cast should be made bool isSigned, ///< Whether to regard S as signed or not - const std::string &Name = "", ///< Name for the instruction + const Twine &Name = "", ///< Name for the instruction Instruction *InsertBefore = 0 ///< Place to insert the instruction ); @@ -388,7 +387,7 @@ public: Value *S, ///< The integer value to be casted (operand 0) const Type *Ty, ///< The integer type to which operand is casted bool isSigned, ///< Whether to regard S as signed or not - const std::string &Name, ///< The name for the instruction + const Twine &Name, ///< The name for the instruction BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); @@ -396,7 +395,7 @@ public: static CastInst *CreateFPCast( 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 + const Twine &Name = "", ///< Name for the instruction Instruction *InsertBefore = 0 ///< Place to insert the instruction ); @@ -404,7 +403,7 @@ public: static CastInst *CreateFPCast( 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 + const Twine &Name, ///< The name for the instruction BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); @@ -412,7 +411,7 @@ public: static CastInst *CreateTruncOrBitCast( Value *S, ///< The value to be casted (operand 0) const Type *Ty, ///< The type to which cast should be made - const std::string &Name = "", ///< Name for the instruction + const Twine &Name = "", ///< Name for the instruction Instruction *InsertBefore = 0 ///< Place to insert the instruction ); @@ -420,7 +419,7 @@ public: static CastInst *CreateTruncOrBitCast( Value *S, ///< The value to be casted (operand 0) const Type *Ty, ///< The type to which operand is casted - const std::string &Name, ///< The name for the instruction + const Twine &Name, ///< The name for the instruction BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); @@ -520,11 +519,11 @@ class CmpInst: public Instruction { CmpInst(); // do not implement protected: CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short pred, - Value *LHS, Value *RHS, const std::string &Name = "", + Value *LHS, Value *RHS, const Twine &Name = "", Instruction *InsertBefore = 0); CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short pred, - Value *LHS, Value *RHS, const std::string &Name, + Value *LHS, Value *RHS, const Twine &Name, BasicBlock *InsertAtEnd); public: @@ -579,7 +578,7 @@ public: /// @brief Create a CmpInst static CmpInst *Create(LLVMContext &Context, OtherOps Op, unsigned short predicate, Value *S1, - Value *S2, const std::string &Name = "", + Value *S2, const Twine &Name = "", Instruction *InsertBefore = 0); /// Construct a compare instruction, given the opcode, the predicate and the @@ -587,8 +586,7 @@ public: /// the BasicBlock specified. /// @brief Create a CmpInst static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1, - Value *S2, const std::string &Name, - BasicBlock *InsertAtEnd); + Value *S2, const Twine &Name, BasicBlock *InsertAtEnd); /// @brief Get the opcode casted to the right type OtherOps getOpcode() const { diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 1afcc5fc05..2b53fac465 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -41,10 +41,10 @@ class LLVMContext; class AllocationInst : public UnaryInstruction { protected: AllocationInst(const Type *Ty, Value *ArraySize, - unsigned iTy, unsigned Align, const std::string &Name = "", + unsigned iTy, unsigned Align, const Twine &Name = "", Instruction *InsertBefore = 0); AllocationInst(const Type *Ty, Value *ArraySize, - unsigned iTy, unsigned Align, const std::string &Name, + unsigned iTy, unsigned Align, const Twine &Name, BasicBlock *InsertAtEnd); public: // Out of line virtual method, so the vtable, etc. has a home. @@ -102,28 +102,28 @@ class MallocInst : public AllocationInst { MallocInst(const MallocInst &MI); public: explicit MallocInst(const Type *Ty, Value *ArraySize = 0, - const std::string &NameStr = "", + const Twine &NameStr = "", Instruction *InsertBefore = 0) : AllocationInst(Ty, ArraySize, Malloc, 0, NameStr, InsertBefore) {} MallocInst(const Type *Ty, Value *ArraySize, - const std::string &NameStr, BasicBlock *InsertAtEnd) + const Twine &NameStr, BasicBlock *InsertAtEnd) : AllocationInst(Ty, ArraySize, Malloc, 0, NameStr, InsertAtEnd) {} - MallocInst(const Type *Ty, const std::string &NameStr, + MallocInst(const Type *Ty, const Twine &NameStr, Instruction *InsertBefore = 0) : AllocationInst(Ty, 0, Malloc, 0, NameStr, InsertBefore) {} - MallocInst(const Type *Ty, const std::string &NameStr, + MallocInst(const Type *Ty, const Twine &NameStr, BasicBlock *InsertAtEnd) : AllocationInst(Ty, 0, Malloc, 0, NameStr, InsertAtEnd) {} MallocInst(const Type *Ty, Value *ArraySize, - unsigned Align, const std::string &NameStr, + unsigned Align, const Twine &NameStr, BasicBlock *InsertAtEnd) : AllocationInst(Ty, ArraySize, Malloc, Align, NameStr, InsertAtEnd) {} MallocInst(const Type *Ty, Value *ArraySize, - unsigned Align, const std::string &NameStr = "", + unsigned Align, const Twine &NameStr = "", Instruction *InsertBefore = 0) : AllocationInst(Ty, ArraySize, Malloc, Align, NameStr, InsertBefore) {} @@ -152,29 +152,29 @@ class AllocaInst : public AllocationInst { public: explicit AllocaInst(const Type *Ty, Value *ArraySize = 0, - const std::string &NameStr = "", + const Twine &NameStr = "", Instruction *InsertBefore = 0) : AllocationInst(Ty, ArraySize, Alloca, 0, NameStr, InsertBefore) {} AllocaInst(const Type *Ty, - Value *ArraySize, const std::string &NameStr, + Value *ArraySize, const Twine &NameStr, BasicBlock *InsertAtEnd) : AllocationInst(Ty, ArraySize, Alloca, 0, NameStr, InsertAtEnd) {} - AllocaInst(const Type *Ty, const std::string &NameStr, + AllocaInst(const Type *Ty, const Twine &NameStr, Instruction *InsertBefore = 0) : AllocationInst(Ty, 0, Alloca, 0, NameStr, InsertBefore) {} - AllocaInst(const Type *Ty, const std::string &NameStr, + AllocaInst(const Type *Ty, const Twine &NameStr, BasicBlock *InsertAtEnd) : AllocationInst(Ty, 0, Alloca, 0, NameStr, InsertAtEnd) {} AllocaInst(const Type *Ty, Value *ArraySize, - unsigned Align, const std::string &NameStr = "", + unsigned Align, const Twine &NameStr = "", Instruction *InsertBefore = 0) : AllocationInst(Ty, ArraySize, Alloca, Align, NameStr, InsertBefore) {} AllocaInst(const Type *Ty, Value *ArraySize, - unsigned Align, const std::string &NameStr, + unsigned Align, const Twine &NameStr, BasicBlock *InsertAtEnd) : AllocationInst(Ty, ArraySize, Alloca, Align, NameStr, InsertAtEnd) {} @@ -246,15 +246,15 @@ class LoadInst : public UnaryInstruction { } void AssertOK(); 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 Twine &NameStr, Instruction *InsertBefore); + LoadInst(Value *Ptr, const Twine &NameStr, BasicBlock *InsertAtEnd); + LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile = false, Instruction *InsertBefore = 0); - LoadInst(Value *Ptr, const std::string &NameStr, bool isVolatile, + LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align, Instruction *InsertBefore = 0); - LoadInst(Value *Ptr, const std::string &NameStr, bool isVolatile, + LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, BasicBlock *InsertAtEnd); - LoadInst(Value *Ptr, const std::string &NameStr, bool isVolatile, + LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align, BasicBlock *InsertAtEnd); LoadInst(Value *Ptr, const char *NameStr, Instruction *InsertBefore); @@ -399,12 +399,12 @@ static inline const Type *checkType(const Type *Ty) { class GetElementPtrInst : public Instruction { GetElementPtrInst(const GetElementPtrInst &GEPI); void init(Value *Ptr, Value* const *Idx, unsigned NumIdx, - const std::string &NameStr); - void init(Value *Ptr, Value *Idx, const std::string &NameStr); + const Twine &NameStr); + void init(Value *Ptr, Value *Idx, const Twine &NameStr); template<typename InputIterator> void init(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, - const std::string &NameStr, + const Twine &NameStr, // This argument ensures that we have an iterator we can // do arithmetic on in constant time std::random_access_iterator_tag) { @@ -451,25 +451,25 @@ class GetElementPtrInst : public Instruction { inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, unsigned Values, - const std::string &NameStr, + const Twine &NameStr, Instruction *InsertBefore); template<typename InputIterator> inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, unsigned Values, - const std::string &NameStr, BasicBlock *InsertAtEnd); + const Twine &NameStr, BasicBlock *InsertAtEnd); /// Constructors - These two constructors are convenience methods because one /// and two index getelementptr instructions are so common. - GetElementPtrInst(Value *Ptr, Value *Idx, const std::string &NameStr = "", + GetElementPtrInst(Value *Ptr, Value *Idx, const Twine &NameStr = "", Instruction *InsertBefore = 0); GetElementPtrInst(Value *Ptr, Value *Idx, - const std::string &NameStr, BasicBlock *InsertAtEnd); + const Twine &NameStr, BasicBlock *InsertAtEnd); public: template<typename InputIterator> static GetElementPtrInst *Create(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, - const std::string &NameStr = "", + const Twine &NameStr = "", Instruction *InsertBefore = 0) { typename std::iterator_traits<InputIterator>::difference_type Values = 1 + std::distance(IdxBegin, IdxEnd); @@ -479,7 +479,7 @@ public: template<typename InputIterator> static GetElementPtrInst *Create(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, - const std::string &NameStr, + const Twine &NameStr, BasicBlock *InsertAtEnd) { typename std::iterator_traits<InputIterator>::difference_type Values = 1 + std::distance(IdxBegin, IdxEnd); @@ -490,12 +490,12 @@ public: /// Constructors - These two creators are convenience methods because one /// index getelementptr instructions are so common. static GetElementPtrInst *Create(Value *Ptr, Value *Idx, - const std::string &NameStr = "", + const Twine &NameStr = "", Instruction *InsertBefore = 0) { return new(2) GetElementPtrInst(Ptr, Idx, NameStr, InsertBefore); } static GetElementPtrInst *Create(Value *Ptr, Value *Idx, - const std::string &NameStr, + const Twine &NameStr, BasicBlock *InsertAtEnd) { return new(2) GetElementPtrInst(Ptr, Idx, NameStr, InsertAtEnd); } @@ -592,7 +592,7 @@ GetElementPtrInst::GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, unsigned Values, - const std::string &NameStr, + const Twine &NameStr, Instruction *InsertBefore) : Instruction(PointerType::get(checkType( getIndexedType(Ptr->getType(), @@ -610,7 +610,7 @@ GetElementPtrInst::GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, unsigned Values, - const std::string &NameStr, + const Twine &NameStr, BasicBlock *InsertAtEnd) : Instruction(PointerType::get(checkType( getIndexedType(Ptr->getType(), @@ -644,7 +644,7 @@ public: Predicate pred, ///< The predicate to use for the comparison Value *LHS, ///< The left-hand-side of the expression Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr = "" ///< Name of the instruction + const Twine &NameStr = "" ///< Name of the instruction ) : CmpInst(InsertBefore->getContext().makeCmpResultType(LHS->getType()), Instruction::ICmp, pred, LHS, RHS, NameStr, InsertBefore) { @@ -665,7 +665,7 @@ public: Predicate pred, ///< The predicate to use for the comparison Value *LHS, ///< The left-hand-side of the expression Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr = "" ///< Name of the instruction + const Twine &NameStr = "" ///< Name of the instruction ) : CmpInst(InsertAtEnd.getContext().makeCmpResultType(LHS->getType()), Instruction::ICmp, pred, LHS, RHS, NameStr, &InsertAtEnd) { @@ -686,7 +686,7 @@ public: Predicate pred, ///< The predicate to use for the comparison Value *LHS, ///< The left-hand-side of the expression Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr = "" ///< Name of the instruction + const Twine &NameStr = "" ///< Name of the instruction ) : CmpInst(Context.makeCmpResultType(LHS->getType()), Instruction::ICmp, pred, LHS, RHS, NameStr) { assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && @@ -819,7 +819,7 @@ public: Predicate pred, ///< The predicate to use for the comparison Value *LHS, ///< The left-hand-side of the expression Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr = "" ///< Name of the instruction + const Twine &NameStr = "" ///< Name of the instruction ) : CmpInst(InsertBefore->getContext().makeCmpResultType(LHS->getType()), Instruction::FCmp, pred, LHS, RHS, NameStr, InsertBefore) { @@ -838,7 +838,7 @@ public: Predicate pred, ///< The predicate to use for the comparison Value *LHS, ///< The left-hand-side of the expression Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr = "" ///< Name of the instruction + const Twine &NameStr = "" ///< Name of the instruction ) : CmpInst(InsertAtEnd.getContext().makeCmpResultType(LHS->getType()), Instruction::FCmp, pred, LHS, RHS, NameStr, &InsertAtEnd) { @@ -857,7 +857,7 @@ public: Predicate pred, ///< The predicate to use for the comparison Value *LHS, ///< The left-hand-side of the expression Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr = "" ///< Name of the instruction + const Twine &NameStr = "" ///< Name of the instruction ) : CmpInst(Context.makeCmpResultType(LHS->getType()), Instruction::FCmp, pred, LHS, RHS, NameStr) { assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && @@ -932,7 +932,7 @@ class CallInst : public Instruction { template<typename InputIterator> void init(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, - const std::string &NameStr, + const Twine &NameStr, // This argument ensures that we have an iterator we can // do arithmetic on in constant time std::random_access_iterator_tag) { @@ -951,7 +951,7 @@ class CallInst : public Instruction { /// @brief Construct a CallInst from a range of arguments template<typename InputIterator> CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, - const std::string &NameStr, Instruction *InsertBefore); + const Twine &NameStr, Instruction *InsertBefore); /// Construct a CallInst given a range of arguments. InputIterator /// must be a random-access iterator pointing to contiguous storage @@ -961,20 +961,20 @@ class CallInst : public Instruction { /// @brief Construct a CallInst from a range of arguments template<typename InputIterator> inline CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, - const std::string &NameStr, BasicBlock *InsertAtEnd); + const Twine &NameStr, BasicBlock *InsertAtEnd); - CallInst(Value *F, Value *Actual, const std::string& NameStr, + CallInst(Value *F, Value *Actual, const Twine &NameStr, Instruction *InsertBefore); - CallInst(Value *F, Value *Actual, const std::string& NameStr, + CallInst(Value *F, Value *Actual, const Twine &NameStr, BasicBlock *InsertAtEnd); - explicit CallInst(Value *F, const std::string &NameStr, + explicit CallInst(Value *F, const Twine &NameStr, Instruction *InsertBefore); - CallInst(Value *F, const std::string &NameStr, BasicBlock *InsertAtEnd); + CallInst(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd); public: template<typename InputIterator> static CallInst *Create(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, - const std::string &NameStr = "", + const Twine &NameStr = "", Instruction *InsertBefore = 0) { return new((unsigned)(ArgEnd - ArgBegin + 1)) CallInst(Func, ArgBegin, ArgEnd, NameStr, InsertBefore); @@ -982,24 +982,24 @@ public: template<typename InputIterator> static CallInst *Create(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, - const std::string &NameStr, BasicBlock *InsertAtEnd) { + const Twine &NameStr, BasicBlock *InsertAtEnd) { return new((unsigned)(ArgEnd - ArgBegin + 1)) CallInst(Func, ArgBegin, ArgEnd, NameStr, InsertAtEnd); } static CallInst *Create(Value *F, Value *Actual, - const std::string& NameStr = "", + const Twine &NameStr = "", Instruction *InsertBefore = 0) { return new(2) CallInst(F, Actual, NameStr, InsertBefore); } - static CallInst *Create(Value *F, Value *Actual, const std::string& NameStr, + static CallInst *Create(Value *F, Value *Actual, const Twine &NameStr, BasicBlock *InsertAtEnd) { return new(2) CallInst(F, Actual, NameStr, InsertAtEnd); } - static CallInst *Create(Value *F, const std::string &NameStr = "", + static CallInst *Create(Value *F, const Twine &NameStr = "", Instruction *InsertBefore = 0) { return new(1) CallInst(F, NameStr, InsertBefore); } - static CallInst *Create(Value *F, const std::string &NameStr, + static CallInst *Create(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd) { return new(1) CallInst(F, NameStr, InsertAtEnd); } @@ -1121,7 +1121,7 @@ struct OperandTraits<CallInst> : VariadicOperandTraits<1> { template<typename InputIterator> CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, - const std::string &NameStr, BasicBlock *InsertAtEnd) + const Twine &NameStr, BasicBlock *InsertAtEnd) : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType()) ->getElementType())->getReturnType(), Instruction::Call, @@ -1133,7 +1133,7 @@ CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, template<typename InputIterator> CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, - const std::string &NameStr, Instruction *InsertBefore) + const Twine &NameStr, Instruction *InsertBefore) : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType()) ->getElementType())->getReturnType(), Instruction::Call, @@ -1163,14 +1163,14 @@ class SelectInst : public Instruction { : Instruction(SI.getType(), SI.getOpcode(), &Op<0>(), 3) { init(SI.Op<0>(), SI.Op<1>(), SI.Op<2>()); } - SelectInst(Value *C, Value *S1, Value *S2, const std::string &NameStr, + SelectInst(Value *C, Value *S1, Value *S2, const Twine &NameStr, Instruction *InsertBefore) : Instruction(S1->getType(), Instruction::Select, &Op<0>(), 3, InsertBefore) { init(C, S1, S2); setName(NameStr); } - SelectInst(Value *C, Value *S1, Value *S2, const std::string &NameStr, + SelectInst(Value *C, Value *S1, Value *S2, const Twine &NameStr, BasicBlock *InsertAtEnd) : Instruction(S1->getType(), Instruction::Select, &Op<0>(), 3, InsertAtEnd) { @@ -1179,12 +1179,12 @@ class SelectInst : public Instruction { } public: static SelectInst *Create(Value *C, Value *S1, Value *S2, - const std::string &NameStr = "", + const Twine &NameStr = "", Instruction *InsertBefore = 0) { return new(3) SelectInst(C, S1, S2, NameStr, InsertBefore); } static SelectInst *Create(Value *C, Value *S1, Value *S2, - const std::string &NameStr, + const Twine &NameStr, BasicBlock *InsertAtEnd) { return new(3) SelectInst(C, S1, S2, NameStr, InsertAtEnd); } @@ -1233,12 +1233,12 @@ class VAArgInst : public UnaryInstruction { VAArgInst(const VAArgInst &VAA) : UnaryInstruction(VAA.getType(), |