[lld] Use llvm::reverse (NFC)

This commit is contained in:
Kazu Hirata 2022-11-06 08:39:41 -08:00
parent f5a2ef80fa
commit d42357007d
1 changed files with 3 additions and 4 deletions

View File

@ -1794,10 +1794,9 @@ static void removeUnusedSyntheticSections() {
// all regular ones. Reverse iterate to find the first synthetic section
// after a non-synthetic one which will be our starting point.
auto start =
std::find_if(
ctx.inputSections.rbegin(), ctx.inputSections.rend(),
[](InputSectionBase *s) { return !isa<SyntheticSection>(s); })
.base();
llvm::find_if(llvm::reverse(ctx.inputSections), [](InputSectionBase *s) {
return !isa<SyntheticSection>(s);
}).base();
// Remove unused synthetic sections from ctx.inputSections;
DenseSet<InputSectionBase *> unused;