OSDN Git Service

[llvm] Revert "[tablegen] Avoid creating a temporary vector in getInstructionCase"
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Tue, 4 Jul 2017 05:37:37 +0000 (05:37 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Tue, 4 Jul 2017 05:37:37 +0000 (05:37 +0000)
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

index 234c2fb..a6b2850 100644 (file)
@@ -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<InstrProfValueSiteRecord> &SiteRecords =
+      getValueSitesForKind(ValueKind);
+  for (auto &SR : SiteRecords) {
     N += SR.ValueData.size();
+  }
   return N;
 }