[PATCH] D144321: [PowerPC] Correctly use ELFv2 ABI on all OS's that use the ELFv2 ABI

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 18 16:42:46 PST 2023


dim accepted this revision.
dim added a comment.
This revision is now accepted and ready to land.

LGTM, some minor clang-format nits, but these aren't critical (to me at least :)



================
Comment at: clang/lib/Basic/Targets/PPC.h:432
+          Triple.getOSMajorVersion() >= 13)) || Triple.isOSOpenBSD() ||
+          Triple.isMusl())
+        ABI = "elfv2";
----------------
clang-format seems to want to format the `if` as:

```
      if ((Triple.isOSFreeBSD() && (Triple.getOSVersion().empty() ||
                                    Triple.getOSMajorVersion() >= 13)) ||
          Triple.isOSOpenBSD() || Triple.isMusl())
```

E,g. it groups the whole FreeBSD expression together. I didn't know it could do this, but it seems relatively clear.


================
Comment at: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:242
+      TT.getOSMajorVersion() >= 13)) || TT.isOSOpenBSD() || TT.isMusl())
+      return PPCTargetMachine::PPC_ABI_ELFv2;
+    else
----------------
similarly for this one, clang-format likes to format it as:
```
     if ((TT.isOSFreeBSD() &&
          (TT.getOSVersion().empty() || TT.getOSMajorVersion() >= 13)) ||
         TT.isOSOpenBSD() || TT.isMusl())
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144321/new/

https://reviews.llvm.org/D144321



More information about the llvm-commits mailing list