X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FMC%2FMCMachOStreamer.cpp;h=03868b00fb8f9f5c03c4a470cf6f0748956c46f5;hp=f7a06158eea6471ef802be26f2a4fc6ec66e9a6a;hb=3f45c27d19f4315437d493ed3c9429b57e2cc59c;hpb=df57a6779d4438ca07ca2b6e2ae4a452155c2496 diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp index f7a06158eea..03868b00fb8 100644 --- a/lib/MC/MCMachOStreamer.cpp +++ b/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); } }