Unverified Commit 3a5f8ae6 authored by Fangrui Song's avatar Fangrui Song Committed by GitHub
Browse files

[ELF] Remove dead stable_sort in TargetInfo::scanSectionImpl. NFC (#195601)

Dead since the code is moved to target-specific relocation scanning.
parent ec0ee3b5
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1133,14 +1133,6 @@ void TargetInfo::scanSectionImpl(InputSectionBase &sec, Relocs<RelTy> rels) {
    auto type = it->getType(false);
    rs.scan<ELFT, RelTy>(it, type, rs.getAddend<ELFT>(*it, type));
  }

  // Sort relocations by offset for more efficient searching for
  // R_RISCV_PCREL_HI20 and the branch-to-branch optimization.
  if (ctx.arg.emachine == EM_RISCV || ctx.arg.branchToBranch)
    llvm::stable_sort(sec.relocs(),
                      [](const Relocation &lhs, const Relocation &rhs) {
                        return lhs.offset < rhs.offset;
                      });
}

template <class ELFT> void TargetInfo::scanSection1(InputSectionBase &sec) {