aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorGabor Ballabas <gaborb@inf.u-szeged.hu>2015-07-20 11:28:20 +0000
committerGabor Ballabas <gaborb@inf.u-szeged.hu>2015-07-20 11:28:20 +0000
commita24a1a411ddc1e1b9dc2d6736aa845475dfbba4d (patch)
treebdc2634b50f2b9c9c8da7c2dda1b1b2a6147550b /clang/lib/Driver/Tools.cpp
parent7d4db6b9d9b3cde8cae88b545c5153474e935135 (diff)
downloadllvm-a24a1a411ddc1e1b9dc2d6736aa845475dfbba4d.zip
llvm-a24a1a411ddc1e1b9dc2d6736aa845475dfbba4d.tar.gz
llvm-a24a1a411ddc1e1b9dc2d6736aa845475dfbba4d.tar.bz2
Allow case-insensitive values for -mtune for AArch64 target in line with GCC.
GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -mtune option for the AArch64 target. Differential Revision: http://reviews.llvm.org/D10563 llvm-svn: 242663
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index fd5c0be..bf85a0d 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -844,7 +844,7 @@ static std::string getAArch64TargetCPU(const ArgList &Args) {
std::string CPU;
// If we have -mtune or -mcpu, use that.
if ((A = Args.getLastArg(options::OPT_mtune_EQ))) {
- CPU = A->getValue();
+ CPU = StringRef(A->getValue()).lower();
} else if ((A = Args.getLastArg(options::OPT_mcpu_EQ))) {
StringRef Mcpu = A->getValue();
CPU = Mcpu.split("+").first.lower();
@@ -1908,10 +1908,11 @@ static bool
getAArch64MicroArchFeaturesFromMtune(const Driver &D, StringRef Mtune,
const ArgList &Args,
std::vector<const char *> &Features) {
+ std::string MtuneLowerCase = Mtune.lower();
// Handle CPU name is 'native'.
- if (Mtune == "native")
- Mtune = llvm::sys::getHostCPUName();
- if (Mtune == "cyclone") {
+ if (MtuneLowerCase == "native")
+ MtuneLowerCase = llvm::sys::getHostCPUName();
+ if (MtuneLowerCase == "cyclone") {
Features.push_back("+zcm");
Features.push_back("+zcz");
}