From: Wei Mi Date: Tue, 5 Feb 2019 00:57:50 +0000 (+0000) Subject: [SamplePGO][NFC] Minor improvement to replace a temporary vector with a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19b99c3cc4812e2f90a8ce53a210419cb5db0cff;p=llvm [SamplePGO][NFC] Minor improvement to replace a temporary vector with a brace-enclosed init list. Differential Revision: https://reviews.llvm.org/D57726 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353129 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/SampleProfile.cpp b/lib/Transforms/IPO/SampleProfile.cpp index bc2ceec8ba4..74831846626 100644 --- a/lib/Transforms/IPO/SampleProfile.cpp +++ b/lib/Transforms/IPO/SampleProfile.cpp @@ -1327,9 +1327,8 @@ void SampleProfileLoader::propagateWeights(Function &F) { SortedCallTargets, Sum, IPVK_IndirectCallTarget, SortedCallTargets.size()); } else if (!dyn_cast(&I)) { - SmallVector Weights; - Weights.push_back(BlockWeights[BB]); - I.setMetadata(LLVMContext::MD_prof, MDB.createBranchWeights(Weights)); + I.setMetadata(LLVMContext::MD_prof, + MDB.createBranchWeights({BlockWeights[BB]})); } } }