diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2012-12-30 19:44:42 +0100 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2012-12-30 19:45:12 +0100 |
commit | a3405b3140a7856fdf0f38c224b38f725db2cb8e (patch) | |
tree | 330dd263c8d9b50cce03e3bfbd19d9f1c1efb255 | |
parent | 78c2bd1f96d78e6d14ad5fd307050811d8f47933 (diff) | |
download | clang-a3405b3140a7856fdf0f38c224b38f725db2cb8e.tar.gz clang-a3405b3140a7856fdf0f38c224b38f725db2cb8e.tar.bz2 clang-a3405b3140a7856fdf0f38c224b38f725db2cb8e.tar.xz |
[Embtk] ARM: getARMTargetCPU(): return default configured cpu if -march and -mcpu are not specified
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r-- | lib/Driver/Tools.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 112c61fcbc..7a07b13072 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -25,6 +25,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/Twine.h" +#include "llvm/Config/config.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" @@ -497,10 +498,18 @@ static std::string getARMTargetCPU(const ArgList &Args, return MCPU; } +#ifdef DEFAULT_TARGET_MCPU + bool useDefaultCPU = true; +#else + bool useDefaultCPU = false; +#endif + StringRef MArch; if (Arg *A = Args.getLastArg(options::OPT_march_EQ)) { // Otherwise, if we have -march= choose the base CPU for that arch. MArch = A->getValue(); + } else if (useDefaultCPU) { + return DEFAULT_TARGET_MCPU; } else { // Otherwise, use the Arch from the triple. MArch = Triple.getArchName(); |