diff options
| author | Jay Foad <jay.foad@gmail.com> | 2011-06-22 08:55:11 +0000 | 
|---|---|---|
| committer | Jay Foad <jay.foad@gmail.com> | 2011-06-22 08:55:11 +0000 | 
| commit | 687bd0ae66015714de18091453f907b626675fbe (patch) | |
| tree | 76465ddb982910495e7164fe09e32313eca5a31a /llvm/lib | |
| parent | c365eeaea6add80126de7c2865c5242e990cd5dd (diff) | |
| download | bcm5719-llvm-687bd0ae66015714de18091453f907b626675fbe.tar.gz bcm5719-llvm-687bd0ae66015714de18091453f907b626675fbe.zip | |
Eliminate a temporary std::vector in ConstantStruct::get().
llvm-svn: 133612
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 6 | 
1 files changed, 2 insertions, 4 deletions
| diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 22d43a7d581..4c03288fe44 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -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);  } | 

