Skip to content

Commit 2ac293f

Browse files
[lld] Use llvm::partition_point (NFC) (#145209)
1 parent 5d7d8d6 commit 2ac293f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lld/ELF/Arch/AArch64.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,9 +1003,8 @@ static std::optional<uint64_t> getControlTransferAddend(InputSection &is,
10031003

10041004
static std::pair<Relocation *, uint64_t>
10051005
getBranchInfoAtTarget(InputSection &is, uint64_t offset) {
1006-
auto *i =
1007-
std::partition_point(is.relocations.begin(), is.relocations.end(),
1008-
[&](Relocation &r) { return r.offset < offset; });
1006+
auto *i = llvm::partition_point(
1007+
is.relocations, [&](Relocation &r) { return r.offset < offset; });
10091008
if (i != is.relocations.end() && i->offset == offset &&
10101009
i->type == R_AARCH64_JUMP26) {
10111010
return {i, i->addend};

lld/ELF/Arch/X86_64.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,9 +1193,8 @@ static std::pair<Relocation *, uint64_t>
11931193
getBranchInfoAtTarget(InputSection &is, uint64_t offset) {
11941194
auto content = is.contentMaybeDecompress();
11951195
if (content.size() > offset && content[offset] == 0xe9) { // JMP immediate
1196-
auto *i = std::partition_point(
1197-
is.relocations.begin(), is.relocations.end(),
1198-
[&](Relocation &r) { return r.offset < offset + 1; });
1196+
auto *i = llvm::partition_point(
1197+
is.relocations, [&](Relocation &r) { return r.offset < offset + 1; });
11991198
// Unlike with getControlTransferAddend() it is valid to accept a PC32
12001199
// relocation here because we know that this is actually a JMP and not some
12011200
// other reference, so the interpretation is that we add 4 to the addend and

0 commit comments

Comments
 (0)