diff options
author | Richard Trieu <rtrieu@google.com> | 2015-04-15 01:21:15 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2015-04-15 01:21:15 +0000 |
commit | 64b905a58db9da2582b2317e9a3193b9460dd05d (patch) | |
tree | ff88bc3186ddc85eb9e5649a56b977af9ade3898 /tools | |
parent | e005d71e4b5447df00e4b8e17d14b1fbcbf29196 (diff) |
Change range-based for-loops to be -Wrange-loop-analysis clean.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-cxxdump/llvm-cxxdump.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tools/llvm-cxxdump/llvm-cxxdump.cpp b/tools/llvm-cxxdump/llvm-cxxdump.cpp index aeb977a5b42..dacb48ab01f 100644 --- a/tools/llvm-cxxdump/llvm-cxxdump.cpp +++ b/tools/llvm-cxxdump/llvm-cxxdump.cpp @@ -355,7 +355,8 @@ static void dumpCXXData(const ObjectFile *Obj) { StringRef SymName = VFTableEntry.second; outs() << VFTableName << '[' << Offset << "]: " << SymName << '\n'; } - for (const std::pair<StringRef, ArrayRef<little32_t>> &VBTable : VBTables) { + for (const std::pair<const StringRef, ArrayRef<little32_t>> &VBTable : + VBTables) { StringRef VBTableName = VBTable.first; uint32_t Idx = 0; for (little32_t Offset : VBTable.second) { @@ -363,7 +364,8 @@ static void dumpCXXData(const ObjectFile *Obj) { Idx += sizeof(Offset); } } - for (const std::pair<StringRef, CompleteObjectLocator> &COLPair : COLs) { + for (const std::pair<const StringRef, CompleteObjectLocator> &COLPair : + COLs) { StringRef COLName = COLPair.first; const CompleteObjectLocator &COL = COLPair.second; outs() << COLName << "[IsImageRelative]: " << COL.Data[0] << '\n'; @@ -373,7 +375,8 @@ static void dumpCXXData(const ObjectFile *Obj) { outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1] << '\n'; } - for (const std::pair<StringRef, ClassHierarchyDescriptor> &CHDPair : CHDs) { + for (const std::pair<const StringRef, ClassHierarchyDescriptor> &CHDPair : + CHDs) { StringRef CHDName = CHDPair.first; const ClassHierarchyDescriptor &CHD = CHDPair.second; outs() << CHDName << "[AlwaysZero]: " << CHD.Data[0] << '\n'; @@ -381,14 +384,14 @@ static void dumpCXXData(const ObjectFile *Obj) { outs() << CHDName << "[NumClasses]: " << CHD.Data[2] << '\n'; outs() << CHDName << "[BaseClassArray]: " << CHD.Symbols[0] << '\n'; } - for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &BCAEntry : - BCAEntries) { + for (const std::pair<const std::pair<StringRef, uint64_t>, StringRef> + &BCAEntry : BCAEntries) { StringRef BCAName = BCAEntry.first.first; uint64_t Offset = BCAEntry.first.second; StringRef SymName = BCAEntry.second; outs() << BCAName << '[' << Offset << "]: " << SymName << '\n'; } - for (const std::pair<StringRef, BaseClassDescriptor> &BCDPair : BCDs) { + for (const std::pair<const StringRef, BaseClassDescriptor> &BCDPair : BCDs) { StringRef BCDName = BCDPair.first; const BaseClassDescriptor &BCD = BCDPair.second; outs() << BCDName << "[TypeDescriptor]: " << BCD.Symbols[0] << '\n'; @@ -400,7 +403,7 @@ static void dumpCXXData(const ObjectFile *Obj) { outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1] << '\n'; } - for (const std::pair<StringRef, TypeDescriptor> &TDPair : TDs) { + for (const std::pair<const StringRef, TypeDescriptor> &TDPair : TDs) { StringRef TDName = TDPair.first; const TypeDescriptor &TD = TDPair.second; outs() << TDName << "[VFPtr]: " << TD.Symbols[0] << '\n'; @@ -410,7 +413,7 @@ static void dumpCXXData(const ObjectFile *Obj) { /*UseHexEscapes=*/true) << '\n'; } - for (const std::pair<StringRef, ThrowInfo> &TIPair : TIs) { + for (const std::pair<const StringRef, ThrowInfo> &TIPair : TIs) { StringRef TIName = TIPair.first; const ThrowInfo &TI = TIPair.second; auto dumpThrowInfoFlag = [&](const char *Name, uint32_t Flag) { @@ -429,7 +432,7 @@ static void dumpCXXData(const ObjectFile *Obj) { dumpThrowInfoSymbol("ForwardCompat", 8); dumpThrowInfoSymbol("CatchableTypeArray", 12); } - for (const std::pair<StringRef, CatchableTypeArray> &CTAPair : CTAs) { + for (const std::pair<const StringRef, CatchableTypeArray> &CTAPair : CTAs) { StringRef CTAName = CTAPair.first; const CatchableTypeArray &CTA = CTAPair.second; @@ -441,7 +444,7 @@ static void dumpCXXData(const ObjectFile *Obj) { I != E; ++I) outs() << CTAName << '[' << Idx++ << "]: " << I->second << '\n'; } - for (const std::pair<StringRef, CatchableType> &CTPair : CTs) { + for (const std::pair<const StringRef, CatchableType> &CTPair : CTs) { StringRef CTName = CTPair.first; const CatchableType &CT = CTPair.second; auto dumpCatchableTypeFlag = [&](const char *Name, uint32_t Flag) { @@ -464,14 +467,14 @@ static void dumpCXXData(const ObjectFile *Obj) { << "[CopyCtor]: " << (CT.Symbols[1].empty() ? "null" : CT.Symbols[1]) << '\n'; } - for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &VTTPair : - VTTEntries) { + for (const std::pair<const std::pair<StringRef, uint64_t>, StringRef> + &VTTPair : VTTEntries) { StringRef VTTName = VTTPair.first.first; uint64_t VTTOffset = VTTPair.first.second; StringRef VTTEntry = VTTPair.second; outs() << VTTName << '[' << VTTOffset << "]: " << VTTEntry << '\n'; } - for (const std::pair<StringRef, StringRef> &TIPair : TINames) { + for (const std::pair<const StringRef, StringRef> &TIPair : TINames) { StringRef TIName = TIPair.first; outs() << TIName << ": " << TIPair.second << '\n'; } |