Skip to content

Commit 17999f0

Browse files
[BPF] Initialize SmallVector (NFC) (llvm#143392)
1 parent 60cd76b commit 17999f0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,7 @@ static void replaceWithGEP(CallInst *Call, uint32_t DimensionIndex,
414414

415415
Constant *Zero =
416416
ConstantInt::get(Type::getInt32Ty(Call->getParent()->getContext()), 0);
417-
SmallVector<Value *, 4> IdxList;
418-
for (unsigned I = 0; I < Dimension; ++I)
419-
IdxList.push_back(Zero);
417+
SmallVector<Value *, 4> IdxList(Dimension, Zero);
420418
IdxList.push_back(Call->getArgOperand(GEPIndex));
421419

422420
auto *GEP = GetElementPtrInst::CreateInBounds(getBaseElementType(Call),

0 commit comments

Comments
 (0)