diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-03-14 14:22:49 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-03-14 14:22:49 +0000 |
commit | 6f07b35b8f7cd4e7ad85d25a968db1daa86535ff (patch) | |
tree | dd0fd53ea0006b6cc14d241f7236ef28364c57c2 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | |
parent | 0eba2c94fd92952234cb2fabff9b1be868cd7f5b (diff) | |
download | llvm-6f07b35b8f7cd4e7ad85d25a968db1daa86535ff.tar.gz llvm-6f07b35b8f7cd4e7ad85d25a968db1daa86535ff.tar.bz2 llvm-6f07b35b8f7cd4e7ad85d25a968db1daa86535ff.tar.xz |
[C++11] Introduce SectionRef::relocations() to use range-based loops
Reviewers: rafael
Reviewed By: rafael
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3077
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index 723a790b87..5d6a2c0f12 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -166,9 +166,7 @@ ObjectImage* RuntimeDyldImpl::loadObject(ObjectImage *InputObject) { StubMap Stubs; section_iterator RelocatedSection = SI->getRelocatedSection(); - for (relocation_iterator I = SI->relocation_begin(), - E = SI->relocation_end(); - I != E; ++I) { + for (const RelocationRef &Reloc : SI->relocations()) { // If it's the first relocation in this section, find its SectionID if (IsFirstRelocation) { bool IsCode = false; @@ -179,7 +177,7 @@ ObjectImage* RuntimeDyldImpl::loadObject(ObjectImage *InputObject) { IsFirstRelocation = false; } - processRelocationRef(SectionID, *I, *Obj, LocalSections, LocalSymbols, + processRelocationRef(SectionID, Reloc, *Obj, LocalSections, LocalSymbols, Stubs); } } @@ -306,13 +304,12 @@ unsigned RuntimeDyldImpl::computeSectionStubBufSize(ObjectImage &Obj, if (!(RelSecI == Section)) continue; - for (relocation_iterator I = SI->relocation_begin(), - E = SI->relocation_end(); - I != E; ++I) { + for (const RelocationRef &Reloc : SI->relocations()) { + (void)Reloc; StubBufSize += StubSize; } } - + // Get section data size and alignment uint64_t Alignment64; uint64_t DataSize; |