aboutsummaryrefslogtreecommitdiff
path: root/lld/COFF/Chunks.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2021-01-20 11:00:58 -0800
committerReid Kleckner <rnk@google.com>2021-01-20 11:01:33 -0800
commit69e0bc77a5d74a5f0e57ad3e7a22ce4fba210b85 (patch)
tree8d0dbf20a3a16fcdb0805fed5c02b92c3af2aaf8 /lld/COFF/Chunks.cpp
parent16d6e8527189298c75bf5690c771e8ab6dc3628d (diff)
downloadllvm-69e0bc77a5d74a5f0e57ad3e7a22ce4fba210b85.zip
llvm-69e0bc77a5d74a5f0e57ad3e7a22ce4fba210b85.tar.gz
llvm-69e0bc77a5d74a5f0e57ad3e7a22ce4fba210b85.tar.bz2
[COFF] Use range for on relocations, NFC
Diffstat (limited to 'lld/COFF/Chunks.cpp')
-rw-r--r--lld/COFF/Chunks.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp
index e04ceed..9d60bc7 100644
--- a/lld/COFF/Chunks.cpp
+++ b/lld/COFF/Chunks.cpp
@@ -357,9 +357,7 @@ void SectionChunk::writeTo(uint8_t *buf) const {
// Apply relocations.
size_t inputSize = getSize();
- for (size_t i = 0, e = relocsSize; i < e; i++) {
- const coff_relocation &rel = relocsData[i];
-
+ for (const coff_relocation &rel : getRelocs()) {
// Check for an invalid relocation offset. This check isn't perfect, because
// we don't have the relocation size, which is only known after checking the
// machine and relocation type. As a result, a relocation may overwrite the
@@ -451,8 +449,7 @@ static uint8_t getBaserelType(const coff_relocation &rel) {
// fixed by the loader if load-time relocation is needed.
// Only called when base relocation is enabled.
void SectionChunk::getBaserels(std::vector<Baserel> *res) {
- for (size_t i = 0, e = relocsSize; i < e; i++) {
- const coff_relocation &rel = relocsData[i];
+ for (const coff_relocation &rel : getRelocs()) {
uint8_t ty = getBaserelType(rel);
if (ty == IMAGE_REL_BASED_ABSOLUTE)
continue;