diff options
| author | Craig Topper <craig.topper@gmail.com> | 2015-10-14 04:36:00 +0000 | 
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2015-10-14 04:36:00 +0000 | 
| commit | 1129a00abf13c495558877dfb35efcaf2e26d21b (patch) | |
| tree | 816715433bc9e52fea27dc3d06b02e07637a546d /llvm/lib | |
| parent | 6910347f62fb4e848f242cce19419d7fe8458e35 (diff) | |
| download | bcm5719-llvm-1129a00abf13c495558877dfb35efcaf2e26d21b.tar.gz bcm5719-llvm-1129a00abf13c495558877dfb35efcaf2e26d21b.zip  | |
Use range-based for loops. NFC
llvm-svn: 250266
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/MC/MCMachOStreamer.cpp | 16 | 
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp index f7a06158eea..03868b00fb8 100644 --- a/llvm/lib/MC/MCMachOStreamer.cpp +++ b/llvm/lib/MC/MCMachOStreamer.cpp @@ -439,9 +439,9 @@ void MCMachOStreamer::EmitInstToData(const MCInst &Inst,    getAssembler().getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);    // Add the fixups and data. -  for (unsigned i = 0, e = Fixups.size(); i != e; ++i) { -    Fixups[i].setOffset(Fixups[i].getOffset() + DF->getContents().size()); -    DF->getFixups().push_back(Fixups[i]); +  for (MCFixup &Fixup : Fixups) { +    Fixup.setOffset(Fixup.getOffset() + DF->getContents().size()); +    DF->getFixups().push_back(Fixup);    }    DF->getContents().append(Code.begin(), Code.end());  } @@ -467,14 +467,12 @@ void MCMachOStreamer::FinishImpl() {    // Set the fragment atom associations by tracking the last seen atom defining    // symbol. -  for (MCAssembler::iterator it = getAssembler().begin(), -         ie = getAssembler().end(); it != ie; ++it) { +  for (MCSection &Sec : getAssembler()) {      const MCSymbol *CurrentAtom = nullptr; -    for (MCSection::iterator it2 = it->begin(), ie2 = it->end(); it2 != ie2; -         ++it2) { -      if (const MCSymbol *Symbol = DefiningSymbolMap.lookup(&*it2)) +    for (MCFragment &Frag : Sec) { +      if (const MCSymbol *Symbol = DefiningSymbolMap.lookup(&Frag))          CurrentAtom = Symbol; -      it2->setAtom(CurrentAtom); +      Frag.setAtom(CurrentAtom);      }    }  | 

