1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[tablegen] Avoid creating a temporary vector in getInstructionCase

Record::getValues returns ArrayRef which has a cast operator
to std::vector, as a result a temporary vector is created
if the type of the variable is const std::vector& 
that was suboptimal in this case.

Differential revision: https://reviews.llvm.org/D34969

Test plan: make check-all

llvm-svn: 307059
This commit is contained in:
Alexander Shaposhnikov 2017-07-04 05:11:30 +00:00
parent 5ffd7d4185
commit 8ae1bcfa19

View File

@ -753,11 +753,8 @@ uint32_t InstrProfRecord::getNumValueKinds() const {
uint32_t InstrProfRecord::getNumValueData(uint32_t ValueKind) const {
uint32_t N = 0;
const std::vector<InstrProfValueSiteRecord> &SiteRecords =
getValueSitesForKind(ValueKind);
for (auto &SR : SiteRecords) {
for (auto &SR : getValueSitesForKind(ValueKind))
N += SR.ValueData.size();
}
return N;
}