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

Brad Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 19 16:50:54 PST 2023


brad marked an inline comment as done.
brad 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())
----------------
nemanjai wrote:
> 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.
> 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.

Ultimately something like that would be better as it's used in 3 different spots.


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