Author: Kazu Hirata Date: 2021-01-17T10:39:47-08:00 New Revision: a59126115e9586dd7fda4bb365ee43682814fc53
URL: https://github.com/llvm/llvm-project/commit/a59126115e9586dd7fda4bb365ee43682814fc53 DIFF: https://github.com/llvm/llvm-project/commit/a59126115e9586dd7fda4bb365ee43682814fc53.diff LOG: [IRBuilder] "Zero"-initialize SmallVector (NFC) Added: Modified: llvm/lib/IR/IRBuilder.cpp Removed: ################################################################################ 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<Value *, 4> IdxList; - for (unsigned I = 0; I < Dimension; ++I) - IdxList.push_back(Zero); + SmallVector<Value *, 4> IdxList(Dimension, Zero); IdxList.push_back(LastIndexV); Type *ResultType = _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits