summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-05-09 13:33:09 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-05-09 13:33:09 +0200
commit660da91bb2dcffdf4bbb91b10a0c4d83bd779896 (patch)
tree3ec73f5be2b0d3280cc3fe61e2e15b4456af9226
parent272f7075ad5ebb169e4b6457875e46f75d2fb2a9 (diff)
downloadclang-660da91bb2dcffdf4bbb91b10a0c4d83bd779896.tar.gz
clang-660da91bb2dcffdf4bbb91b10a0c4d83bd779896.tar.bz2
clang-660da91bb2dcffdf4bbb91b10a0c4d83bd779896.tar.xz
[Embtk] ARM: getARMTargetCPU(): correctly use default configured in all places
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r--lib/Driver/ToolChain.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
index de8ed1d1c5..e5040c6845 100644
--- a/lib/Driver/ToolChain.cpp
+++ b/lib/Driver/ToolChain.cpp
@@ -17,6 +17,7 @@
#include "clang/Driver/Option.h"
#include "clang/Driver/Options.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/Config/config.h"
#include "llvm/Support/ErrorHandling.h"
#include "clang/Basic/ObjCRuntime.h"
using namespace clang::driver;
@@ -79,6 +80,14 @@ ObjCRuntime ToolChain::getDefaultObjCRuntime(bool isNonFragile) const {
// FIXME: tblgen this.
static const char *getARMTargetCPU(const ArgList &Args,
const llvm::Triple &Triple) {
+
+ const char *DefaultCPU;
+#ifdef DEFAULT_TARGET_MCPU
+ bool useDefaultCPU = true;
+ DefaultCPU = DEFAULT_TARGET_MCPU;
+#else
+ bool useDefaultCPU = false;
+#endif
// For Darwin targets, the -arch option (which is translated to a
// corresponding -march option) should determine the architecture
// (and the Mach-O slice) regardless of any -mcpu options.
@@ -87,6 +96,8 @@ static const char *getARMTargetCPU(const ArgList &Args,
// If we have -mcpu=, use that.
if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ))
return A->getValue();
+ else if (useDefaultCPU)
+ return DefaultCPU;
}
StringRef MArch;