aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-10-14 04:36:00 +0000
committerCraig Topper <craig.topper@gmail.com>2015-10-14 04:36:00 +0000
commit1129a00abf13c495558877dfb35efcaf2e26d21b (patch)
tree816715433bc9e52fea27dc3d06b02e07637a546d /llvm/lib/MC/MCMachOStreamer.cpp
parent6910347f62fb4e848f242cce19419d7fe8458e35 (diff)
downloadllvm-1129a00abf13c495558877dfb35efcaf2e26d21b.zip
llvm-1129a00abf13c495558877dfb35efcaf2e26d21b.tar.gz
llvm-1129a00abf13c495558877dfb35efcaf2e26d21b.tar.bz2
Use range-based for loops. NFC
llvm-svn: 250266
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index f7a0615..03868b00 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);
}
}