[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
This commit is contained in:
Alexey Samsonov
2014-03-13 07:52:54 +00:00
parent 7c801675f8
commit 72df688950
16 changed files with 162 additions and 164 deletions

View File

@ -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";