diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-03-13 07:52:54 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-03-13 07:52:54 +0000 |
commit | 72df68895059f778ae2f6b1264fc98415133b66e (patch) | |
tree | 108f0ecaea9e236ccc6de295a016abf039234b6a /lib/DebugInfo/DWARFDebugAbbrev.cpp | |
parent | 7c801675f8a0d079281fead832f0eb642ad3a6c5 (diff) | |
download | llvm-72df68895059f778ae2f6b1264fc98415133b66e.tar.gz llvm-72df68895059f778ae2f6b1264fc98415133b66e.tar.bz2 llvm-72df68895059f778ae2f6b1264fc98415133b66e.tar.xz |
[C++11] Convert DWARF parser to range-based for loops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFDebugAbbrev.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFDebugAbbrev.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/DebugInfo/DWARFDebugAbbrev.cpp b/lib/DebugInfo/DWARFDebugAbbrev.cpp index 6e6c37e309..fd5f5e95fc 100644 --- a/lib/DebugInfo/DWARFDebugAbbrev.cpp +++ b/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); } } |