mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-25 00:29:20 +00:00
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
This commit is contained in:
parent
2a4a6fecf0
commit
0df445b460
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user