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 | 1eabf98b3277cc44e0263c05155791cfe6d2c221 (patch) | |
tree | d97ef3fcb847e9b97c5384e116b1a4af20eecdf3 /llvm/lib/DebugInfo/DWARFDebugFrame.cpp | |
parent | aae4dc21ea12d91a2687923755a6eb80dba5f2da (diff) | |
download | bcm5719-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/DWARFDebugFrame.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFDebugFrame.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugFrame.cpp b/llvm/lib/DebugInfo/DWARFDebugFrame.cpp index b268f300155..5bf7b070b8e 100644 --- a/llvm/lib/DebugInfo/DWARFDebugFrame.cpp +++ b/llvm/lib/DebugInfo/DWARFDebugFrame.cpp @@ -186,10 +186,8 @@ void FrameEntry::parseInstructions(uint32_t *Offset, uint32_t EndOffset) { void FrameEntry::dumpInstructions(raw_ostream &OS) const { // TODO: at the moment only instruction names are dumped. Expand this to // dump operands as well. - for (std::vector<Instruction>::const_iterator I = Instructions.begin(), - E = Instructions.end(); - I != E; ++I) { - uint8_t Opcode = I->Opcode; + for (const auto &Instr : Instructions) { + uint8_t Opcode = Instr.Opcode; if (Opcode & DWARF_CFI_PRIMARY_OPCODE_MASK) Opcode &= DWARF_CFI_PRIMARY_OPCODE_MASK; OS << " " << CallFrameString(Opcode) << ":\n"; @@ -289,9 +287,8 @@ DWARFDebugFrame::DWARFDebugFrame() { DWARFDebugFrame::~DWARFDebugFrame() { - for (EntryVector::iterator I = Entries.begin(), E = Entries.end(); - I != E; ++I) { - delete *I; + for (const auto &Entry : Entries) { + delete Entry; } } @@ -381,9 +378,7 @@ void DWARFDebugFrame::parse(DataExtractor Data) { void DWARFDebugFrame::dump(raw_ostream &OS) const { OS << "\n"; - for (EntryVector::const_iterator I = Entries.begin(), E = Entries.end(); - I != E; ++I) { - FrameEntry *Entry = *I; + for (const auto &Entry : Entries) { Entry->dumpHeader(OS); Entry->dumpInstructions(OS); OS << "\n"; |