Change range-based for-loop to use const auto&. No functionality change.

llvm-svn: 234974
This commit is contained in:
Richard Trieu 2015-04-15 03:17:49 +00:00
parent 8a7b84b4d0
commit 46f2cc9e44
1 changed files with 11 additions and 16 deletions

View File

@ -355,8 +355,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
StringRef SymName = VFTableEntry.second; StringRef SymName = VFTableEntry.second;
outs() << VFTableName << '[' << Offset << "]: " << SymName << '\n'; outs() << VFTableName << '[' << Offset << "]: " << SymName << '\n';
} }
for (const std::pair<const StringRef, ArrayRef<little32_t>> &VBTable : for (const auto &VBTable : VBTables) {
VBTables) {
StringRef VBTableName = VBTable.first; StringRef VBTableName = VBTable.first;
uint32_t Idx = 0; uint32_t Idx = 0;
for (little32_t Offset : VBTable.second) { for (little32_t Offset : VBTable.second) {
@ -364,8 +363,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
Idx += sizeof(Offset); Idx += sizeof(Offset);
} }
} }
for (const std::pair<const StringRef, CompleteObjectLocator> &COLPair : for (const auto &COLPair : COLs) {
COLs) {
StringRef COLName = COLPair.first; StringRef COLName = COLPair.first;
const CompleteObjectLocator &COL = COLPair.second; const CompleteObjectLocator &COL = COLPair.second;
outs() << COLName << "[IsImageRelative]: " << COL.Data[0] << '\n'; outs() << COLName << "[IsImageRelative]: " << COL.Data[0] << '\n';
@ -375,8 +373,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1] outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1]
<< '\n'; << '\n';
} }
for (const std::pair<const StringRef, ClassHierarchyDescriptor> &CHDPair : for (const auto &CHDPair : CHDs) {
CHDs) {
StringRef CHDName = CHDPair.first; StringRef CHDName = CHDPair.first;
const ClassHierarchyDescriptor &CHD = CHDPair.second; const ClassHierarchyDescriptor &CHD = CHDPair.second;
outs() << CHDName << "[AlwaysZero]: " << CHD.Data[0] << '\n'; outs() << CHDName << "[AlwaysZero]: " << CHD.Data[0] << '\n';
@ -384,14 +381,13 @@ static void dumpCXXData(const ObjectFile *Obj) {
outs() << CHDName << "[NumClasses]: " << CHD.Data[2] << '\n'; outs() << CHDName << "[NumClasses]: " << CHD.Data[2] << '\n';
outs() << CHDName << "[BaseClassArray]: " << CHD.Symbols[0] << '\n'; outs() << CHDName << "[BaseClassArray]: " << CHD.Symbols[0] << '\n';
} }
for (const std::pair<const std::pair<StringRef, uint64_t>, StringRef> for (const auto &BCAEntry : BCAEntries) {
&BCAEntry : BCAEntries) {
StringRef BCAName = BCAEntry.first.first; StringRef BCAName = BCAEntry.first.first;
uint64_t Offset = BCAEntry.first.second; uint64_t Offset = BCAEntry.first.second;
StringRef SymName = BCAEntry.second; StringRef SymName = BCAEntry.second;
outs() << BCAName << '[' << Offset << "]: " << SymName << '\n'; outs() << BCAName << '[' << Offset << "]: " << SymName << '\n';
} }
for (const std::pair<const StringRef, BaseClassDescriptor> &BCDPair : BCDs) { for (const auto &BCDPair : BCDs) {
StringRef BCDName = BCDPair.first; StringRef BCDName = BCDPair.first;
const BaseClassDescriptor &BCD = BCDPair.second; const BaseClassDescriptor &BCD = BCDPair.second;
outs() << BCDName << "[TypeDescriptor]: " << BCD.Symbols[0] << '\n'; outs() << BCDName << "[TypeDescriptor]: " << BCD.Symbols[0] << '\n';
@ -403,7 +399,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1] outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1]
<< '\n'; << '\n';
} }
for (const std::pair<const StringRef, TypeDescriptor> &TDPair : TDs) { for (const auto &TDPair : TDs) {
StringRef TDName = TDPair.first; StringRef TDName = TDPair.first;
const TypeDescriptor &TD = TDPair.second; const TypeDescriptor &TD = TDPair.second;
outs() << TDName << "[VFPtr]: " << TD.Symbols[0] << '\n'; outs() << TDName << "[VFPtr]: " << TD.Symbols[0] << '\n';
@ -413,7 +409,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
/*UseHexEscapes=*/true) /*UseHexEscapes=*/true)
<< '\n'; << '\n';
} }
for (const std::pair<const StringRef, ThrowInfo> &TIPair : TIs) { for (const auto &TIPair : TIs) {
StringRef TIName = TIPair.first; StringRef TIName = TIPair.first;
const ThrowInfo &TI = TIPair.second; const ThrowInfo &TI = TIPair.second;
auto dumpThrowInfoFlag = [&](const char *Name, uint32_t Flag) { auto dumpThrowInfoFlag = [&](const char *Name, uint32_t Flag) {
@ -432,7 +428,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
dumpThrowInfoSymbol("ForwardCompat", 8); dumpThrowInfoSymbol("ForwardCompat", 8);
dumpThrowInfoSymbol("CatchableTypeArray", 12); dumpThrowInfoSymbol("CatchableTypeArray", 12);
} }
for (const std::pair<const StringRef, CatchableTypeArray> &CTAPair : CTAs) { for (const auto &CTAPair : CTAs) {
StringRef CTAName = CTAPair.first; StringRef CTAName = CTAPair.first;
const CatchableTypeArray &CTA = CTAPair.second; const CatchableTypeArray &CTA = CTAPair.second;
@ -444,7 +440,7 @@ static void dumpCXXData(const ObjectFile *Obj) {
I != E; ++I) I != E; ++I)
outs() << CTAName << '[' << Idx++ << "]: " << I->second << '\n'; outs() << CTAName << '[' << Idx++ << "]: " << I->second << '\n';
} }
for (const std::pair<const StringRef, CatchableType> &CTPair : CTs) { for (const auto &CTPair : CTs) {
StringRef CTName = CTPair.first; StringRef CTName = CTPair.first;
const CatchableType &CT = CTPair.second; const CatchableType &CT = CTPair.second;
auto dumpCatchableTypeFlag = [&](const char *Name, uint32_t Flag) { auto dumpCatchableTypeFlag = [&](const char *Name, uint32_t Flag) {
@ -467,14 +463,13 @@ static void dumpCXXData(const ObjectFile *Obj) {
<< "[CopyCtor]: " << (CT.Symbols[1].empty() ? "null" : CT.Symbols[1]) << "[CopyCtor]: " << (CT.Symbols[1].empty() ? "null" : CT.Symbols[1])
<< '\n'; << '\n';
} }
for (const std::pair<const std::pair<StringRef, uint64_t>, StringRef> for (const auto &VTTPair : VTTEntries) {
&VTTPair : VTTEntries) {
StringRef VTTName = VTTPair.first.first; StringRef VTTName = VTTPair.first.first;
uint64_t VTTOffset = VTTPair.first.second; uint64_t VTTOffset = VTTPair.first.second;
StringRef VTTEntry = VTTPair.second; StringRef VTTEntry = VTTPair.second;
outs() << VTTName << '[' << VTTOffset << "]: " << VTTEntry << '\n'; outs() << VTTName << '[' << VTTOffset << "]: " << VTTEntry << '\n';
} }
for (const std::pair<const StringRef, StringRef> &TIPair : TINames) { for (const auto &TIPair : TINames) {
StringRef TIName = TIPair.first; StringRef TIName = TIPair.first;
outs() << TIName << ": " << TIPair.second << '\n'; outs() << TIName << ": " << TIPair.second << '\n';
} }