diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 4d332fe255ae..d12acb524e55 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -717,7 +717,7 @@ Constant *ConstantArray::get(ArrayType *Ty, ArrayRef V) { /// Constant *ConstantArray::get(LLVMContext &Context, StringRef Str, bool AddNull) { - std::vector ElementVals; + SmallVector ElementVals; ElementVals.reserve(Str.size() + size_t(AddNull)); for (unsigned i = 0; i < Str.size(); ++i) ElementVals.push_back(ConstantInt::get(Type::getInt8Ty(Context), Str[i])); @@ -1957,7 +1957,7 @@ const char *ConstantExpr::getOpcodeName() const { GetElementPtrConstantExpr:: -GetElementPtrConstantExpr(Constant *C, const std::vector &IdxList, +GetElementPtrConstantExpr(Constant *C, ArrayRef IdxList, Type *DestTy) : ConstantExpr(DestTy, Instruction::GetElementPtr, OperandTraits::op_end(this) @@ -2469,7 +2469,7 @@ void ConstantVector::replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) { assert(isa(To) && "Cannot make Constant refer to non-constant!"); - std::vector Values; + SmallVector Values; Values.reserve(getNumOperands()); // Build replacement array... for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { Constant *Val = getOperand(i); diff --git a/llvm/lib/VMCore/ConstantsContext.h b/llvm/lib/VMCore/ConstantsContext.h index 4bdeaa78302a..b7726944a22f 100644 --- a/llvm/lib/VMCore/ConstantsContext.h +++ b/llvm/lib/VMCore/ConstantsContext.h @@ -211,11 +211,11 @@ public: /// used behind the scenes to implement getelementpr constant exprs. class GetElementPtrConstantExpr : public ConstantExpr { virtual void anchor(); - GetElementPtrConstantExpr(Constant *C, const std::vector &IdxList, + GetElementPtrConstantExpr(Constant *C, ArrayRef IdxList, Type *DestTy); public: static GetElementPtrConstantExpr *Create(Constant *C, - const std::vector&IdxList, + ArrayRef IdxList, Type *DestTy, unsigned Flags) { GetElementPtrConstantExpr *Result =