[PATCH] D145610: [clang][driver][AIX] accept maix32/maix64 gcc compat options

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 30 12:12:08 PDT 2023


MaskRay added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:598
+  // The `-maix[32|64]` flags are only valid for AIX targets.
+  if (Arg *A = Args.getLastArgNoClaim(options::OPT_maix32, options::OPT_maix64);
+      A && !Target.isOSAIX())
----------------
It'd be nice to leverage the `TargetSpecific` mechanism introduced in D151590 to simplify code here.


================
Comment at: clang/lib/Driver/Driver.cpp:602
+        << A->getAsString(Args) << Target.str();
+
   // Handle pseudo-target flags '-m64', '-mx32', '-m32' and '-m16'.
----------------
Does AIX use -m32/-m64? If not, reject the two options on AIX.

It may be cleaner to do

```
if (AIX) {
  ... // introduce a new block of code here
} else {
  existing `Target.setEnvironment` code
}
```

-mx32 is x86-specific


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145610



More information about the cfe-commits mailing list