From 19b99c3cc4812e2f90a8ce53a210419cb5db0cff Mon Sep 17 00:00:00 2001 From: Wei Mi Date: Tue, 5 Feb 2019 00:57:50 +0000 Subject: [PATCH] [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 --- lib/Transforms/IPO/SampleProfile.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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]})); } } } -- 2.50.1