summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-07-11 15:23:33 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-07-11 15:23:33 +0000
commitbdaffd6c6bb6f82ffe76fdfb0394c050c9a9b9a8 (patch)
tree91c6ec5c1c3d2961d3b7f1ebc7aa9f263ede6d7a /lld
parent1aa8f39dc083e4f8499ab82e1bab271a16f9b9d8 (diff)
downloadbcm5719-llvm-bdaffd6c6bb6f82ffe76fdfb0394c050c9a9b9a8.tar.gz
bcm5719-llvm-bdaffd6c6bb6f82ffe76fdfb0394c050c9a9b9a8.zip
[ELF] - Simplify code. NFC.
This looks a bit simpler IMO. llvm-svn: 336815
Diffstat (limited to 'lld')
-rw-r--r--lld/ELF/Writer.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 2f58be57b23..08d95384052 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1441,16 +1441,13 @@ template <class ELFT> void Writer<ELFT>::resolveShfLinkOrder() {
// previous one. This does not require any rewriting of InputSection
// contents but misses opportunities for fine grained deduplication
// where only a subset of the InputSection contents can be merged.
- int Cur = 1;
- int Prev = 0;
+ size_t Prev = 0;
// The last one is a sentinel entry which should not be removed.
- int N = Sections.size() - 1;
- while (Cur < N) {
- if (isDuplicateArmExidxSec(Sections[Prev], Sections[Cur]))
- Sections[Cur] = nullptr;
+ for (size_t I = 1; I < Sections.size() - 1; ++I) {
+ if (isDuplicateArmExidxSec(Sections[Prev], Sections[I]))
+ Sections[I] = nullptr;
else
- Prev = Cur;
- ++Cur;
+ Prev = I;
}
}
}
OpenPOWER on IntegriCloud