From 0a28cfdff5e2e48454ba66f27fa9670d5dcc9cd5 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 30 Jul 2022 16:32:42 -0700 Subject: [PATCH] [ELF] Simplify getRankProximity. NFC --- lld/ELF/Writer.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 375aa68..e4e6cb2 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1100,14 +1100,10 @@ template void Writer::setReservedSymbolSections() { // The more branches in getSectionRank that match, the more similar they are. // Since each branch corresponds to a bit flag, we can just use // countLeadingZeros. -static int getRankProximityAux(const OutputSection &a, const OutputSection &b) { - return countLeadingZeros(a.sortRank ^ b.sortRank); -} - static int getRankProximity(OutputSection *a, SectionCommand *b) { auto *osd = dyn_cast(b); return (osd && osd->osec.hasInputSections) - ? getRankProximityAux(*a, osd->osec) + ? countLeadingZeros(a->sortRank ^ osd->osec.sortRank) : -1; } -- 2.7.4