[yaml2obj][ELF] Use range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Atanasyan 2014-03-14 06:53:30 +00:00
parent 9e30b78485
commit 74f42fd948

View File

@ -186,8 +186,7 @@ addSymbols(const std::vector<ELFYAML::Symbol> &Symbols, ELFState<ELFT> &State,
std::vector<typename object::ELFFile<ELFT>::Elf_Sym> &Syms,
unsigned SymbolBinding) {
typedef typename object::ELFFile<ELFT>::Elf_Sym Elf_Sym;
for (unsigned i = 0, e = Symbols.size(); i != e; ++i) {
const ELFYAML::Symbol &Sym = Symbols[i];
for (const auto &Sym : Symbols) {
Elf_Sym Symbol;
zero(Symbol);
if (!Sym.Name.empty())
@ -310,8 +309,7 @@ static int writeELF(raw_ostream &OS, const ELFYAML::Object &Doc) {
zero(SHdr);
SHeaders.push_back(SHdr);
}
for (unsigned i = 0, e = Sections.size(); i != e; ++i) {
const ELFYAML::Section &Sec = Sections[i];
for (const auto &Sec : Sections) {
Elf_Shdr SHeader;
zero(SHeader);
SHeader.sh_name = SHStrTab.addString(Sec.Name);