1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Eliminate a temporary std::vector in ConstantStruct::get().

llvm-svn: 133612
This commit is contained in:
Jay Foad 2011-06-22 08:55:11 +00:00
parent f921ffd79e
commit f653a9e838

View File

@ -666,10 +666,8 @@ Constant *ConstantStruct::get(const StructType *ST, ArrayRef<Constant*> 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);
}