summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-03-13 07:52:54 +0000
committerAlexey Samsonov <samsonov@google.com>2014-03-13 07:52:54 +0000
commit1eabf98b3277cc44e0263c05155791cfe6d2c221 (patch)
treed97ef3fcb847e9b97c5384e116b1a4af20eecdf3 /llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
parentaae4dc21ea12d91a2687923755a6eb80dba5f2da (diff)
downloadbcm5719-llvm-1eabf98b3277cc44e0263c05155791cfe6d2c221.tar.gz
bcm5719-llvm-1eabf98b3277cc44e0263c05155791cfe6d2c221.zip
[C++11] Convert DWARF parser to range-based for loops
llvm-svn: 203766
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp b/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
index 6e6c37e3094..fd5f5e95fc1 100644
--- a/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
+++ b/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
@@ -33,19 +33,17 @@ bool DWARFAbbreviationDeclarationSet::extract(DataExtractor data,
}
void DWARFAbbreviationDeclarationSet::dump(raw_ostream &OS) const {
- for (unsigned i = 0, e = Decls.size(); i != e; ++i)
- Decls[i].dump(OS);
+ for (const auto &Decl : Decls)
+ Decl.dump(OS);
}
const DWARFAbbreviationDeclaration*
DWARFAbbreviationDeclarationSet::getAbbreviationDeclaration(uint32_t abbrCode)
const {
if (IdxOffset == UINT32_MAX) {
- DWARFAbbreviationDeclarationCollConstIter pos;
- DWARFAbbreviationDeclarationCollConstIter end = Decls.end();
- for (pos = Decls.begin(); pos != end; ++pos) {
- if (pos->getCode() == abbrCode)
- return &(*pos);
+ for (const auto &Decl : Decls) {
+ if (Decl.getCode() == abbrCode)
+ return &Decl;
}
} else {
uint32_t idx = abbrCode - IdxOffset;
@@ -81,10 +79,9 @@ void DWARFDebugAbbrev::dump(raw_ostream &OS) const {
return;
}
- DWARFAbbreviationDeclarationCollMapConstIter pos;
- for (pos = AbbrevCollMap.begin(); pos != AbbrevCollMap.end(); ++pos) {
- OS << format("Abbrev table for offset: 0x%8.8" PRIx64 "\n", pos->first);
- pos->second.dump(OS);
+ for (const auto &I : AbbrevCollMap) {
+ OS << format("Abbrev table for offset: 0x%8.8" PRIx64 "\n", I.first);
+ I.second.dump(OS);
}
}
OpenPOWER on IntegriCloud