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

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 19 16:47:36 PST 2023


nemanjai added inline comments.


================
Comment at: clang/lib/Basic/Targets/PPC.h:430-432
+      if ((Triple.isOSFreeBSD() && (Triple.getOSVersion().empty() ||
+                                    Triple.getOSMajorVersion() >= 13)) ||
+          Triple.isOSOpenBSD() || Triple.isMusl())
----------------
I am generally not a fan of keeping multiple instances of a somewhat complex conditions in sync. I wonder if the community would be OK with one of:
- Adding a static function in `Triple.h` to test this (`static bool isPPCELFv2ABI(const Triple &)`)
- Adding a member function `Triple::isPPCELFv2ABI()` (similar to `Triple::isWatchABI()`)

Then of course, we can use that function in both places.


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