[lld] [ELF] Orphan placement: prefer the last similar section when its rank <= orphan's rank (PR #94099)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 3 11:22:19 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff a088c61d5c409ec0b8994340866d5864ba913516 70fe99e729816cc6e3957a5094b057d009252823 -- lld/ELF/Writer.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index e777d486f4..40665e01ce 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -945,9 +945,8 @@ findOrphanPos(SmallVectorImpl<SectionCommand *>::iterator b,
auto i = e;
for (auto j = b; j != e; ++j) {
int p = getRankProximity(sec, *j);
- if (p > maxP ||
- (p == maxP && maxP >= 0 &&
- cast<OutputDesc>(*j)->osec.sortRank <= sec->sortRank)) {
+ if (p > maxP || (p == maxP && maxP >= 0 &&
+ cast<OutputDesc>(*j)->osec.sortRank <= sec->sortRank)) {
maxP = p;
i = j;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/94099
More information about the llvm-commits
mailing list