[PATCH] D32853: [ELF] - Speedup readAddressArea() implementation.
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 4 10:27:25 PDT 2017
dblaikie added inline comments.
================
Comment at: ELF/SyntheticSections.cpp:1712-1715
+ auto E = llvm::remove_if(V, [](InputSectionBase *IS) {
+ return !IS || IS == &InputSection::Discarded || !IS->getSize();
+ });
+ V.erase(E, V.end());
----------------
This is often done nested like this, if you like
V.erase(llvm::remove_if(V, []...), V.end());
================
Comment at: ELF/SyntheticSections.cpp:1722
+ for (std::pair<uint64_t, uint64_t> &R : Ranges) {
+ auto I = std::lower_bound(V.begin(), V.end(), R.first,
+ [](InputSectionBase *IS, uint64_t Offset) {
----------------
Is 'V' guaranteed to be sorted?
================
Comment at: ELF/SyntheticSections.cpp:1726
+ });
+ if (I == V.end())
+ continue;
----------------
need any error handling for if R.first isn't in any entry in V?
https://reviews.llvm.org/D32853
More information about the llvm-commits
mailing list