Use const vector references instead of a vector copy. Spotted by Devang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147694 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2012-01-06 23:03:34 +00:00
parent 547abbb40b
commit fa03db0d2d

View File

@ -1767,7 +1767,7 @@ void DwarfDebug::emitAccelNames() {
for (StringMap<std::vector<DIE*> >::const_iterator for (StringMap<std::vector<DIE*> >::const_iterator
GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) { GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) {
const char *Name = GI->getKeyData(); const char *Name = GI->getKeyData();
std::vector<DIE *> Entities = GI->second; const std::vector<DIE *> &Entities = GI->second;
for (std::vector<DIE *>::const_iterator DI = Entities.begin(), for (std::vector<DIE *>::const_iterator DI = Entities.begin(),
DE = Entities.end(); DI != DE; ++DI) DE = Entities.end(); DI != DE; ++DI)
AT.AddName(Name, (*DI)); AT.AddName(Name, (*DI));
@ -1796,7 +1796,7 @@ void DwarfDebug::emitAccelObjC() {
for (StringMap<std::vector<DIE*> >::const_iterator for (StringMap<std::vector<DIE*> >::const_iterator
GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) { GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) {
const char *Name = GI->getKeyData(); const char *Name = GI->getKeyData();
std::vector<DIE *> Entities = GI->second; const std::vector<DIE *> &Entities = GI->second;
for (std::vector<DIE *>::const_iterator DI = Entities.begin(), for (std::vector<DIE *>::const_iterator DI = Entities.begin(),
DE = Entities.end(); DI != DE; ++DI) DE = Entities.end(); DI != DE; ++DI)
AT.AddName(Name, (*DI)); AT.AddName(Name, (*DI));
@ -1825,7 +1825,7 @@ void DwarfDebug::emitAccelNamespaces() {
for (StringMap<std::vector<DIE*> >::const_iterator for (StringMap<std::vector<DIE*> >::const_iterator
GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) { GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) {
const char *Name = GI->getKeyData(); const char *Name = GI->getKeyData();
std::vector<DIE *> Entities = GI->second; const std::vector<DIE *> &Entities = GI->second;
for (std::vector<DIE *>::const_iterator DI = Entities.begin(), for (std::vector<DIE *>::const_iterator DI = Entities.begin(),
DE = Entities.end(); DI != DE; ++DI) DE = Entities.end(); DI != DE; ++DI)
AT.AddName(Name, (*DI)); AT.AddName(Name, (*DI));
@ -1860,7 +1860,7 @@ void DwarfDebug::emitAccelTypes() {
for (StringMap<std::vector<std::pair<DIE*, unsigned> > >::const_iterator for (StringMap<std::vector<std::pair<DIE*, unsigned> > >::const_iterator
GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) { GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) {
const char *Name = GI->getKeyData(); const char *Name = GI->getKeyData();
std::vector<std::pair<DIE *, unsigned> > Entities = GI->second; const std::vector<std::pair<DIE *, unsigned> > &Entities = GI->second;
for (std::vector<std::pair<DIE *, unsigned> >::const_iterator DI for (std::vector<std::pair<DIE *, unsigned> >::const_iterator DI
= Entities.begin(), DE = Entities.end(); DI !=DE; ++DI) = Entities.begin(), DE = Entities.end(); DI !=DE; ++DI)
AT.AddName(Name, (*DI).first, (*DI).second); AT.AddName(Name, (*DI).first, (*DI).second);