diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-11-03 18:04:07 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-11-03 18:04:07 +0000 |
commit | e0550a80a4afc6edb2ffcbe051bd109b7203dec6 (patch) | |
tree | 508b33efb8555d9dac32799f9a1aae1b937e9055 /llvm/lib/MC/MCELFStreamer.cpp | |
parent | 53feb8c10b1e0f795367dbb730e7e94b7ff0410b (diff) | |
download | bcm5719-llvm-e0550a80a4afc6edb2ffcbe051bd109b7203dec6.tar.gz bcm5719-llvm-e0550a80a4afc6edb2ffcbe051bd109b7203dec6.zip |
Move code out of a loop and use a range loop.
llvm-svn: 251952
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCELFStreamer.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp index fc4f8a6281b..12cf06cbe5c 100644 --- a/llvm/lib/MC/MCELFStreamer.cpp +++ b/llvm/lib/MC/MCELFStreamer.cpp @@ -619,16 +619,14 @@ void MCELFStreamer::EmitBundleUnlock() { } void MCELFStreamer::Flush() { - for (std::vector<LocalCommon>::const_iterator i = LocalCommons.begin(), - e = LocalCommons.end(); - i != e; ++i) { - const MCSymbol &Symbol = *i->Symbol; - uint64_t Size = i->Size; - unsigned ByteAlignment = i->ByteAlignment; - MCSection &Section = *getAssembler().getContext().getELFSection( - ".bss", ELF::SHT_NOBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC); - - getAssembler().registerSection(Section); + MCSection &Section = *getAssembler().getContext().getELFSection( + ".bss", ELF::SHT_NOBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC); + getAssembler().registerSection(Section); + + for (const LocalCommon &L : LocalCommons) { + const MCSymbol &Symbol = *L.Symbol; + uint64_t Size = L.Size; + unsigned ByteAlignment = L.ByteAlignment; new MCAlignFragment(ByteAlignment, 0, 1, ByteAlignment, &Section); MCFragment *F = new MCFillFragment(0, 0, Size, &Section); |