[llvm-commits] [llvm] r149077 - in /llvm/trunk/lib/VMCore: Constants.cpp ConstantsContext.h
Chris Lattner
sabre at nondot.org
Thu Jan 26 12:40:56 PST 2012
Author: lattner
Date: Thu Jan 26 14:40:56 2012
New Revision: 149077
URL: http://llvm.org/viewvc/llvm-project?rev=149077&view=rev
Log:
smallvectorize and ArrayRef'ize some stuff.
Modified:
llvm/trunk/lib/VMCore/Constants.cpp
llvm/trunk/lib/VMCore/ConstantsContext.h
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=149077&r1=149076&r2=149077&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Thu Jan 26 14:40:56 2012
@@ -717,7 +717,7 @@
///
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 @@
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 @@
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);
Modified: llvm/trunk/lib/VMCore/ConstantsContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantsContext.h?rev=149077&r1=149076&r2=149077&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/ConstantsContext.h (original)
+++ llvm/trunk/lib/VMCore/ConstantsContext.h Thu Jan 26 14:40:56 2012
@@ -211,11 +211,11 @@
/// 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 =
More information about the llvm-commits
mailing list