diff options
author | Eric Christopher <echristo@gmail.com> | 2015-07-10 18:25:54 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2015-07-10 18:25:54 +0000 |
commit | 71e5e3defefcaf1d60291aec4f46c7ede308d0c7 (patch) | |
tree | 1ecd6ce2948a1859a7b3e962228f883e196941ca /clang/lib/Driver/Tools.cpp | |
parent | e6b7cf478751ba4ffafed50163d9d3e0e0981fd0 (diff) | |
download | llvm-71e5e3defefcaf1d60291aec4f46c7ede308d0c7.zip llvm-71e5e3defefcaf1d60291aec4f46c7ede308d0c7.tar.gz llvm-71e5e3defefcaf1d60291aec4f46c7ede308d0c7.tar.bz2 |
Refactor PPC ABI handling to accept and silently ignore -mabi=altivec.
All of the ABIs we support are altivec style anyhow and so the option
doesn't make much sense with the modern ABIs. We could make this a more
noisy ignore, but it would break builds for projects that just pass
it along by default because of historical reasons.
llvm-svn: 241925
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index c52d7a6..38c3d5c 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1272,9 +1272,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { // Select the ABI to use. const char *ABIName = nullptr; - if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) { - ABIName = A->getValue(); - } else if (getToolChain().getTriple().isOSLinux()) + if (getToolChain().getTriple().isOSLinux()) switch (getToolChain().getArch()) { case llvm::Triple::ppc64: { // When targeting a processor that supports QPX, or if QPX is @@ -1299,6 +1297,13 @@ void Clang::AddPPCTargetArgs(const ArgList &Args, break; } + if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) + // The ppc64 linux abis are all "altivec" abis by default. Accept and ignore + // the option if given as we don't have backend support for any targets + // that don't use the altivec abi. + if (StringRef(A->getValue()) != "altivec") + ABIName = A->getValue(); + if (ABIName) { CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName); |