[PATCH] D134671: [Driver] Prevent Mips specific code from claiming -mabi argument on other targets.

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 14:46:31 PDT 2022


arichardson added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:637
   // accordingly to provided ABI name.
-  A = Args.getLastArg(options::OPT_mabi_EQ);
+  A = Args.getLastArgNoClaim(options::OPT_mabi_EQ);
   if (A && Target.isMIPS()) {
----------------
Would it make more sense to move this into the if? It makes the diff bigger since everything inside has to be reindented, but only querying the flag if target is MIPS seems cleaner to me than the noclaim+a->claim approach.


================
Comment at: clang/lib/Driver/Driver.cpp:661
   // provided architecture name
   A = Args.getLastArg(options::OPT_march_EQ);
   if (A && Target.isRISCV()) {
----------------
Don't we have the same problem here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134671



More information about the cfe-commits mailing list