diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2013-05-08 13:32:01 +0200 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2013-05-10 15:59:17 +0200 |
commit | 4951b22627923986945a394a88bfbd8adcaeb2ff (patch) | |
tree | c8202a9695375b262663664a22c27fde4f389782 | |
parent | ac8bf73dbf325ffaf2f0acff676a18f87fea5311 (diff) | |
download | clang-4951b22627923986945a394a88bfbd8adcaeb2ff.tar.gz clang-4951b22627923986945a394a88bfbd8adcaeb2ff.tar.bz2 clang-4951b22627923986945a394a88bfbd8adcaeb2ff.tar.xz |
[Embtk]: MIPS: when there is no -mabi=, default to the one used at configure time if any
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
(cherry picked from commit 4246e656912860716a62366e837d17bd31ce5785)
-rw-r--r-- | lib/Driver/Tools.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 0a8b44d153..d57377cfdb 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -900,14 +900,24 @@ static void getMipsCPUAndABI(const ArgList &Args, } } - if (!ABIName.empty()) { + // if -mabi= was not specified and there is a default abi configured, use it. + if (ABIName.empty() && llvm::sys::hasDefaultTargetAbi()) { + StringRef DefaultABIName = llvm::sys::getDefaultTargetAbi(); + ABIName = llvm::StringSwitch<llvm::StringRef>(DefaultABIName) + .Cases("32", "o32", "o32") + .Cases("64", "n64", "n64") + .Case("n32", "n32") + .Default(""); + } + + if (!ABIName.empty() && CPUName.empty()) { // Deduce CPU name from ABI name. CPUName = llvm::StringSwitch<const char *>(ABIName) .Cases("32", "o32", "eabi", DefMips32CPU) .Cases("n32", "n64", "64", DefMips64CPU) .Default(""); } - else if (!CPUName.empty()) { + else if (!CPUName.empty() && ABIName.empty()) { // Deduce ABI name from CPU name. ABIName = llvm::StringSwitch<const char *>(CPUName) .Cases("mips32", "mips32r2", "o32") |