[PATCH] D89684: [AIX] Add mabi=vec-extabi options to enable the AIX extended and default vector ABIs.

Zarko Todorovski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 14:06:26 PST 2020


ZarkoCA marked 7 inline comments as done.
ZarkoCA added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4624
+
+  if (Triple.isOSAIX()) {
+    if (Args.hasArg(options::OPT_maltivec) &&
----------------
Xiangling_L wrote:
> line 4624 to line 4635 can be simplified to :
> 
> ```
>   if (Triple.isOSAIX() && Args.hasArg(options::OPT_maltivec) {
>     if (Args.hasArg(options::OPT_mabi_EQ_vec_extabi)) {
>       CmdArgs.push_back("-mabi=vec-extabi");
>     } else {
>       D.Diag(diag::err_aix_default_altivec_abi);
>     }
>   }
> ```
> 
> or even simplify line 4617 -4636 to the following if it works:
> 
> ```
>   if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ_vec_extabi,
>                                options::OPT_mabi_EQ_vec_default)) {
>     if (!Triple.isOSAIX())
>       D.Diag(diag::err_drv_unsupported_opt_for_target)
>           << A->getSpelling() << RawTriple.str();
> 
>     if (!Args.hasArg(options::OPT_maltivec))
>       D.Diag(diag::err_aix_altivec);
> 
>     if (Args.hasArg(options::OPT_mabi_EQ_vec_default))
>       D.Diag(diag::err_aix_default_altivec_abi);
> 
>     CmdArgs.push_back("-mabi=vec-extabi");
>   } else if (Triple.isOSAIX() && Args.hasArg(options::OPT_maltivec) {
>       D.Diag(diag::err_aix_default_altivec_abi);
>   }
> ```
I really like the first suggestion, thank you. 


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:1445
+          Args.getLastArg(OPT_mabi_EQ_vec_default, OPT_mabi_EQ_vec_extabi)) {
+    if (!T.isOSAIX() || !T.isOSBinFormatXCOFF())
+      Diags.Report(diag::err_drv_unsupported_opt_for_target)
----------------
Xiangling_L wrote:
> Hi Zarko, is the above comment missed being addressed?
Sorry, that one snuck back in there after I thought I removed it. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89684



More information about the cfe-commits mailing list