aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
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 84fa0b3..9433a7e 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -753,12 +753,13 @@ static void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple,
if (const Arg *A = Args.getLastArg(options::OPT_mhwdiv_EQ))
getARMHWDivFeatures(D, A, Args, Features);
- // Check if -march is valid by checking if it can be canonicalised. getARMArch
- // is used here instead of just checking the -march value in order to handle
- // -march=native correctly.
+ // Check if -march is valid by checking if it can be canonicalised and parsed.
+ // getARMArch is used here instead of just checking the -march value in order
+ // to handle -march=native correctly.
if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) {
StringRef Arch = arm::getARMArch(Args, Triple);
- if (llvm::ARMTargetParser::getCanonicalArchName(Arch).empty())
+ Arch = llvm::ARMTargetParser::getCanonicalArchName(Arch);
+ if (llvm::ARMTargetParser::parseArch(Arch) == llvm::ARM::AK_INVALID)
D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args);
}