[lld] [lld][macho][NFC] Factor count zeros into helper function (PR #161241)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 10:27:13 PDT 2025


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 origin/main HEAD --extensions cpp -- lld/MachO/SyntheticSections.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp
index d38b6c9e0..5645d8a05 100644
--- a/lld/MachO/SyntheticSections.cpp
+++ b/lld/MachO/SyntheticSections.cpp
@@ -1723,7 +1723,7 @@ void CStringSection::writeTo(uint8_t *buf) const {
 // `A`, but ld64 will treat them as being 16-byte aligned with an offset of
 // `16 % A`.
 static uint8_t getStringPieceAlignment(const CStringInputSection *isec,
-                                     const StringPiece &piece) {
+                                       const StringPiece &piece) {
   return llvm::countr_zero(isec->align | piece.inSecOff);
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/161241


More information about the llvm-commits mailing list