From: Jay Foad Date: Wed, 22 Jun 2011 08:55:11 +0000 (+0000) Subject: Eliminate a temporary std::vector in ConstantStruct::get(). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0df445b460d09f2ddd230e9119ddb72038268146;p=oota-llvm.git Eliminate a temporary std::vector in ConstantStruct::get(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133612 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 22d43a7d581..4c03288fe44 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -666,10 +666,8 @@ Constant *ConstantStruct::get(const StructType *ST, ArrayRef V) { // Create a ConstantAggregateZero value if all elements are zeros. for (unsigned i = 0, e = V.size(); i != e; ++i) - if (!V[i]->isNullValue()) { - // FIXME: Eliminate temporary std::vector here! - return ST->getContext().pImpl->StructConstants.getOrCreate(ST, V.vec()); - } + if (!V[i]->isNullValue()) + return ST->getContext().pImpl->StructConstants.getOrCreate(ST, V); return ConstantAggregateZero::get(ST); }