From f82e25012a99118c06f85398ff6fd09a23fa88a7 Mon Sep 17 00:00:00 2001 From: Alexander Shaposhnikov Date: Tue, 4 Jul 2017 05:37:37 +0000 Subject: [PATCH] [llvm] Revert "[tablegen] Avoid creating a temporary vector in getInstructionCase" Revert rL307059 because of the incorrect commit message & patch, will recommit later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307061 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ProfileData/InstrProf.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/llvm/ProfileData/InstrProf.h b/include/llvm/ProfileData/InstrProf.h index 234c2fbeb03..a6b2850ccd2 100644 --- a/include/llvm/ProfileData/InstrProf.h +++ b/include/llvm/ProfileData/InstrProf.h @@ -753,8 +753,11 @@ uint32_t InstrProfRecord::getNumValueKinds() const { uint32_t InstrProfRecord::getNumValueData(uint32_t ValueKind) const { uint32_t N = 0; - for (auto &SR : getValueSitesForKind(ValueKind)) + const std::vector &SiteRecords = + getValueSitesForKind(ValueKind); + for (auto &SR : SiteRecords) { N += SR.ValueData.size(); + } return N; } -- 2.11.0