[clang] eb3426a - [AIX] Improve option processing for mabi=vec-extabi and mabi=vec=defaul
Zarko Todorovski via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 2 07:59:38 PST 2021
Author: Zarko Todorovski
Date: 2021-02-02T10:59:21-05:00
New Revision: eb3426a528d5b3cbbb54aee662a779f2067fc9db
URL: https://github.com/llvm/llvm-project/commit/eb3426a528d5b3cbbb54aee662a779f2067fc9db
DIFF: https://github.com/llvm/llvm-project/commit/eb3426a528d5b3cbbb54aee662a779f2067fc9db.diff
LOG: [AIX] Improve option processing for mabi=vec-extabi and mabi=vec=defaul
Opening this revision to better address comments by @hubert.reinterpretcast in https://reviews.llvm.org/rGcaaaebcde462
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D95702
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/CodeGen/altivec.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 431f534c38fe..e2b9dc29868a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -4669,23 +4669,15 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
}
}
- if (Triple.isOSAIX() && Args.hasArg(options::OPT_maltivec)) {
- if (Args.getLastArg(options::OPT_mabi_EQ_vec_extabi)) {
- CmdArgs.push_back("-mabi=vec-extabi");
- } else {
- D.Diag(diag::err_aix_default_altivec_abi);
- }
- }
-
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 (A->getOption().getID() == options::OPT_mabi_EQ_vec_default)
- D.Diag(diag::err_aix_default_altivec_abi);
if (A->getOption().getID() == options::OPT_mabi_EQ_vec_extabi)
CmdArgs.push_back("-mabi=vec-extabi");
+ else
+ D.Diag(diag::err_aix_default_altivec_abi);
}
if (Arg *A = Args.getLastArg(options::OPT_Wframe_larger_than_EQ)) {
diff --git a/clang/test/CodeGen/altivec.c b/clang/test/CodeGen/altivec.c
index d69c34d82190..86b570f15d08 100644
--- a/clang/test/CodeGen/altivec.c
+++ b/clang/test/CodeGen/altivec.c
@@ -6,9 +6,6 @@
// RUN: %clang_cc1 -target-feature +altivec -mabi=vec-extabi -target-cpu pwr8 -triple powerpc64-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE
// RUN: not %clang_cc1 -target-feature +altivec -mabi=vec-default -target-cpu pwr8 -triple powerpc-unknown-aix -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR
// RUN: not %clang_cc1 -target-feature +altivec -mabi=vec-default -target-cpu pwr8 -triple powerpc64-unknown-aix -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR
-
-// RUN: not %clang -S -emit-llvm -maltivec -mcpu=pwr8 -target powerpc-unknown-aix %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR
-// RUN: not %clang -S -emit-llvm -maltivec -mcpu=pwr8 -target powerpc64-unknown-aix %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR
// RUN: %clang -S -emit-llvm -maltivec -mabi=vec-extabi -mcpu=pwr8 -target powerpc-unknown-aix %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE
// RUN: %clang -S -emit-llvm -maltivec -mabi=vec-extabi -mcpu=pwr8 -target powerpc64-unknown-aix %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE
// RUN: not %clang -S -emit-llvm -maltivec -mabi=vec-default -mcpu=pwr8 -triple powerpc-unknown-aix -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR
More information about the cfe-commits
mailing list