Index: lib/Driver/ToolChains.cpp =================================================================== --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -126,7 +126,7 @@ } static const char *GetArmArchForMCpu(StringRef Value) { - return llvm::StringSwitch(Value) + return llvm::StringSwitch(Value.lower()) .Cases("arm9e", "arm946e-s", "arm966e-s", "arm968e-s", "arm926ej-s","armv5") .Cases("arm10e", "arm10tdmi", "armv5") .Cases("arm1020t", "arm1020e", "arm1022e", "arm1026ej-s", "armv5") Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -895,7 +895,7 @@ if ((A = Args.getLastArg(options::OPT_mtune_EQ))) { CPU = A->getValue(); } else if ((A = Args.getLastArg(options::OPT_mcpu_EQ))) { - StringRef Mcpu = A->getValue(); + StringRef Mcpu = StringRef(A->getValue()).lower(); CPU = Mcpu.split("+").first; } @@ -1826,7 +1826,7 @@ const ArgList &Args, std::vector &Features) { StringRef CPU; - if (!DecodeAArch64Mcpu(D, Mcpu, CPU, Features)) + if (!DecodeAArch64Mcpu(D, Mcpu.lower(), CPU, Features)) return false; return true; @@ -1852,7 +1852,7 @@ std::vector &Features) { StringRef CPU; std::vector DecodedFeature; - if (!DecodeAArch64Mcpu(D, Mcpu, CPU, DecodedFeature)) + if (!DecodeAArch64Mcpu(D, Mcpu.lower(), CPU, DecodedFeature)) return false; return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features); @@ -5613,7 +5613,7 @@ // FIXME: Warn on inconsistent use of -mcpu and -march. // If we have -mcpu=, use that. if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { - StringRef MCPU = A->getValue(); + StringRef MCPU = StringRef(A->getValue()).lower(); // Handle -mcpu=native. if (MCPU == "native") return llvm::sys::getHostCPUName(); @@ -7482,7 +7482,7 @@ // march from being picked in the absence of a cpu flag. Arg *A; if ((A = Args.getLastArg(options::OPT_mcpu_EQ)) && - StringRef(A->getValue()) == "krait") + StringRef(A->getValue()).lower() == "krait") CmdArgs.push_back("-march=armv7-a"); else Args.AddLastArg(CmdArgs, options::OPT_mcpu_EQ);