diff options
author | Renato Golin <renato.golin@linaro.org> | 2015-05-22 18:17:55 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2015-05-22 18:17:55 +0000 |
commit | fadc210817bb197c249758880814abf57dda9937 (patch) | |
tree | 962bcedbec4ac98913d4e9f28d2f7e39d708b91f /llvm/lib/Support/Triple.cpp | |
parent | 494eb606cdeba7935bd0f6591b95aefa412ccff9 (diff) | |
download | llvm-fadc210817bb197c249758880814abf57dda9937.zip llvm-fadc210817bb197c249758880814abf57dda9937.tar.gz llvm-fadc210817bb197c249758880814abf57dda9937.tar.bz2 |
Adding profile and version parsers to ARMTargetParser
This allows us to match armv6m to default to thumb, but will also be used by
Clang's driver and remove the current incomplete copy in it.
llvm-svn: 238036
Diffstat (limited to 'llvm/lib/Support/Triple.cpp')
-rw-r--r-- | llvm/lib/Support/Triple.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp index b862dbd..6ef50a5 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -281,8 +281,16 @@ static Triple::ArchType parseARMArch(StringRef ArchName) { (ArchName.startswith("v2") || ArchName.startswith("v3"))) return Triple::UnknownArch; - // FIXME: Add isMProfile to ARMTargetParser and - // either change armv6m to thumb or UnknownArch. + // Thumb only for v6m + unsigned Profile = ARMTargetParser::parseArchProfile(ArchName); + unsigned Version = ARMTargetParser::parseArchVersion(ArchName); + if (Profile == ARM::PK_M && Version == 6) { + if (ENDIAN == ARM::EK_BIG) + return Triple::thumbeb; + else + return Triple::thumb; + } + return arch; } |