diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2013-05-08 13:32:01 +0200 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-05-09 23:20:48 +0200 |
commit | e6a64fb34c576b4de995daebfdcd65aec9302fba (patch) | |
tree | 731b685d38d2117484cc573a7290c76cffd35a63 | |
parent | dc8dcac88936d5c879f2cfd37a275b3fa9cc7860 (diff) | |
download | clang-e6a64fb34c576b4de995daebfdcd65aec9302fba.tar.gz clang-e6a64fb34c576b4de995daebfdcd65aec9302fba.tar.bz2 clang-e6a64fb34c576b4de995daebfdcd65aec9302fba.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>
-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 90d43227bc..61c66cc35f 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -950,14 +950,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") |