[ARM] Reject invalid -march values
authorJohn Brawn <john.brawn@arm.com>
Fri, 8 May 2015 12:52:02 +0000 (12:52 +0000)
committerJohn Brawn <john.brawn@arm.com>
Fri, 8 May 2015 12:52:02 +0000 (12:52 +0000)
commit62f973306c3a8d1cd92b0e53c352d74a12075b29
treeba155d08e7b688a6dad71b1c592efc2bf6fe78b0
parentbaac106e1dfa8791cad921f8230d182068539215
[ARM] Reject invalid -march values

Restructure Triple::getARMCPUForArch so that invalid values will
return nullptr, while retaining the behaviour that an argument
specifying no particular architecture version will give a default
CPU. This will be used by clang to give an error on invalid -march
values.

Also restructure the extraction of the architecture version from
the MArch string a little to hopefully make what it's doing clearer.

Differential Revision: http://reviews.llvm.org/D9599

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236845 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Triple.cpp
unittests/ADT/TripleTest.cpp