aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorGabor Ballabas <gaborb@inf.u-szeged.hu>2015-06-12 17:33:37 +0000
committerGabor Ballabas <gaborb@inf.u-szeged.hu>2015-06-12 17:33:37 +0000
commit726ce7fc571a511f628736ba94ee113334ee3e60 (patch)
tree9a46c88ab25f9b4114f38494f0352580b1cea353 /clang/lib/Driver/Tools.cpp
parentc74ac023d83730307835b6c67bbfb326b64eaf62 (diff)
downloadllvm-726ce7fc571a511f628736ba94ee113334ee3e60.zip
llvm-726ce7fc571a511f628736ba94ee113334ee3e60.tar.gz
llvm-726ce7fc571a511f628736ba94ee113334ee3e60.tar.bz2
Allow case-insensitive values for -mcpu 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 -mcpu option for the AArch64 target. llvm-svn: 239619
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index fb277d4..a2f3c196 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -850,7 +850,7 @@ static std::string getAArch64TargetCPU(const ArgList &Args) {
CPU = A->getValue();
} else if ((A = Args.getLastArg(options::OPT_mcpu_EQ))) {
StringRef Mcpu = A->getValue();
- CPU = Mcpu.split("+").first;
+ CPU = Mcpu.split("+").first.lower();
}
// Handle CPU name is 'native'.
@@ -1893,7 +1893,8 @@ getAArch64ArchFeaturesFromMcpu(const Driver &D, StringRef Mcpu,
const ArgList &Args,
std::vector<const char *> &Features) {
StringRef CPU;
- if (!DecodeAArch64Mcpu(D, Mcpu, CPU, Features))
+ std::string McpuLowerCase = Mcpu.lower();
+ if (!DecodeAArch64Mcpu(D, McpuLowerCase, CPU, Features))
return false;
return true;
@@ -1919,7 +1920,8 @@ getAArch64MicroArchFeaturesFromMcpu(const Driver &D, StringRef Mcpu,
std::vector<const char *> &Features) {
StringRef CPU;
std::vector<const char *> DecodedFeature;
- if (!DecodeAArch64Mcpu(D, Mcpu, CPU, DecodedFeature))
+ std::string McpuLowerCase = Mcpu.lower();
+ if (!DecodeAArch64Mcpu(D, McpuLowerCase, CPU, DecodedFeature))
return false;
return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features);