[clang] [llvm] Fix alignments for NetBSD/m68k. (PR #207602)

via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 20 11:03:56 PDT 2026


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 -- clang/lib/Basic/Targets/M68k.cpp llvm/lib/TargetParser/TargetDataLayout.cpp --diff_from_common_commit
``````````

: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/llvm/lib/TargetParser/TargetDataLayout.cpp b/llvm/lib/TargetParser/TargetDataLayout.cpp
index 8e66998a0..83bc4a624 100644
--- a/llvm/lib/TargetParser/TargetDataLayout.cpp
+++ b/llvm/lib/TargetParser/TargetDataLayout.cpp
@@ -120,7 +120,6 @@ static std::string computeLoongArchDataLayout(const Triple &TT) {
   return "e-m:e-p:32:32-i64:64-n32-S128";
 }
 
-
 // The Linux m68k target uses the ABI used
 // by Sun Microsystems for the old a.out-based binaries: 16-bit
 // alignment of int/long/pointer.
@@ -140,7 +139,7 @@ static std::string computeM68kDataLayout(const Triple &TT) {
   // FIXME how to wire it with the used object format?
   Ret += "-m:e";
 
-  if (! TT.isOSNetBSD()) {
+  if (!TT.isOSNetBSD()) {
     // M68k pointers are always 32 bit wide even for 16-bit CPUs.
     // The ABI only specifies 16-bit alignment.
     // On at least the 68020+ with a 32-bit bus, there is a performance benefit

``````````

</details>


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


More information about the cfe-commits mailing list