From a59126115e9586dd7fda4bb365ee43682814fc53 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 17 Jan 2021 10:39:47 -0800 Subject: [PATCH] [IRBuilder] "Zero"-initialize SmallVector (NFC) --- llvm/lib/IR/IRBuilder.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp index 7e76a6c2a055..91ca984b755c 100644 --- a/llvm/lib/IR/IRBuilder.cpp +++ b/llvm/lib/IR/IRBuilder.cpp @@ -1047,9 +1047,7 @@ Value *IRBuilderBase::CreatePreserveArrayAccessIndex( Value *LastIndexV = getInt32(LastIndex); Constant *Zero = ConstantInt::get(Type::getInt32Ty(Context), 0); - SmallVector IdxList; - for (unsigned I = 0; I < Dimension; ++I) - IdxList.push_back(Zero); + SmallVector IdxList(Dimension, Zero); IdxList.push_back(LastIndexV); Type *ResultType =