summaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains/Arch
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2017-08-10 15:42:16 +0000
committerSimon Atanasyan <simon@atanasyan.com>2017-08-10 15:42:16 +0000
commit99bc550ed3f7970869cd9d7d7826ee65d1dcff42 (patch)
tree0107d4577c4d902009d1501da19c0c46bf068b07 /lib/Driver/ToolChains/Arch
parentf9f008684ee86cd47a90e9b8af57e0bb90e67f0b (diff)
downloadclang-99bc550ed3f7970869cd9d7d7826ee65d1dcff42.tar.gz
[mips] Notify user that `-mabicalls` is ignored on non-PIC N64 ABI
The -mabicalls option does not make sense in the case of non position independent code for the N64 ABI. After this change the driver shows a warning that -mabicalls is ignored in that case. Differential revision: https://reviews.llvm.org/D36550 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains/Arch')
-rw-r--r--lib/Driver/ToolChains/Arch/Mips.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Driver/ToolChains/Arch/Mips.cpp b/lib/Driver/ToolChains/Arch/Mips.cpp
index c11e251835..2a0d6eeeb9 100644
--- a/lib/Driver/ToolChains/Arch/Mips.cpp
+++ b/lib/Driver/ToolChains/Arch/Mips.cpp
@@ -227,11 +227,23 @@ void mips::getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple,
O.matches(options::OPT_fno_PIE) || O.matches(options::OPT_fno_pie));
}
- if (IsN64 && NonPIC)
+ bool UseAbiCalls = false;
+
+ Arg *ABICallsArg =
+ Args.getLastArg(options::OPT_mabicalls, options::OPT_mno_abicalls);
+ UseAbiCalls =
+ !ABICallsArg ||
+ (ABICallsArg && ABICallsArg->getOption().matches(options::OPT_mabicalls));
+
+ if (UseAbiCalls && IsN64 && NonPIC) {
+ D.Diag(diag::warn_drv_unsupported_abicalls);
+ UseAbiCalls = false;
+ }
+
+ if (!UseAbiCalls)
Features.push_back("+noabicalls");
else
- AddTargetFeature(Args, Features, options::OPT_mno_abicalls,
- options::OPT_mabicalls, "noabicalls");
+ Features.push_back("-noabicalls");
mips::FloatABI FloatABI = mips::getMipsFloatABI(D, Args);
if (FloatABI == mips::FloatABI::Soft) {