summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-05-05 00:15:34 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-05-10 15:59:15 +0200
commit86a67a6c5a1306abbf4df62305ebd060c319f19d (patch)
tree2f46ca0cfdd30c45910a76a0af1c734d81f6e939
parent5fffe15266849b71f53f49929430299b5611ed0f (diff)
downloadclang-86a67a6c5a1306abbf4df62305ebd060c319f19d.tar.gz
clang-86a67a6c5a1306abbf4df62305ebd060c319f19d.tar.bz2
clang-86a67a6c5a1306abbf4df62305ebd060c319f19d.tar.xz
[Embtk] ARM: getARMTargetCPU(): use default configured cpu if -march and -mcpu are not specified
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org> (cherry picked from commit ad029c3645d110504539b4a847a2f72b8142b71d)
-rw-r--r--lib/Driver/Tools.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index c3664e953a..5916df2d4d 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -489,6 +489,9 @@ static std::string getARMTargetCPU(const ArgList &Args,
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 (llvm::sys::hasDefaultTargetCpu()) {
+ // Default target mcpu was configured, return it!
+ return llvm::sys::getDefaultTargetCpu();
} else {
// Otherwise, use the Arch from the triple.
MArch = Triple.getArchName();