diff options
author | Chris Lattner <sabre@nondot.org> | 2012-01-26 20:40:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-01-26 20:40:56 +0000 |
commit | a7c698823e4ffa4589bde1ff6de60b6af0cdba5a (patch) | |
tree | 620b8ac38e04446773dda5c29c667f96ec3de50b /lib/VMCore | |
parent | 1a8def6ad6b7b114abd31524d73ad8062a82fbc8 (diff) | |
download | external_llvm-a7c698823e4ffa4589bde1ff6de60b6af0cdba5a.zip external_llvm-a7c698823e4ffa4589bde1ff6de60b6af0cdba5a.tar.gz external_llvm-a7c698823e4ffa4589bde1ff6de60b6af0cdba5a.tar.bz2 |
smallvectorize and ArrayRef'ize some stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Constants.cpp | 6 | ||||
-rw-r--r-- | lib/VMCore/ConstantsContext.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 4d332fe..d12acb5 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -717,7 +717,7 @@ Constant *ConstantArray::get(ArrayType *Ty, ArrayRef<Constant*> V) { /// Constant *ConstantArray::get(LLVMContext &Context, StringRef Str, bool AddNull) { - std::vector<Constant*> ElementVals; + SmallVector<Constant*, 8> 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<Constant*> &IdxList, +GetElementPtrConstantExpr(Constant *C, ArrayRef<Constant*> IdxList, Type *DestTy) : ConstantExpr(DestTy, Instruction::GetElementPtr, OperandTraits<GetElementPtrConstantExpr>::op_end(this) @@ -2469,7 +2469,7 @@ void ConstantVector::replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) { assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!"); - std::vector<Constant*> Values; + SmallVector<Constant*, 8> Values; Values.reserve(getNumOperands()); // Build replacement array... for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { Constant *Val = getOperand(i); diff --git a/lib/VMCore/ConstantsContext.h b/lib/VMCore/ConstantsContext.h index 4bdeaa7..b772694 100644 --- a/lib/VMCore/ConstantsContext.h +++ b/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<Constant*> &IdxList, + GetElementPtrConstantExpr(Constant *C, ArrayRef<Constant*> IdxList, Type *DestTy); public: static GetElementPtrConstantExpr *Create(Constant *C, - const std::vector<Constant*>&IdxList, + ArrayRef<Constant*> IdxList, Type *DestTy, unsigned Flags) { GetElementPtrConstantExpr *Result = |