[llvm-commits] [llvm] r133612 - /llvm/trunk/lib/VMCore/Constants.cpp
Jay Foad
jay.foad at gmail.com
Wed Jun 22 01:55:11 PDT 2011
Author: foad
Date: Wed Jun 22 03:55:11 2011
New Revision: 133612
URL: http://llvm.org/viewvc/llvm-project?rev=133612&view=rev
Log:
Eliminate a temporary std::vector in ConstantStruct::get().
Modified:
llvm/trunk/lib/VMCore/Constants.cpp
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=133612&r1=133611&r2=133612&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Wed Jun 22 03:55:11 2011
@@ -666,10 +666,8 @@
// 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);
}
More information about the llvm-commits
mailing list