aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMSubtarget.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-03-09 20:25:39 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-03-09 20:25:39 +0000
commita5de2fc079f65072277595a7a6e763762081a124 (patch)
tree7b849463c9039ec31fc7d797b08c6adc3c0804c9 /lib/Target/ARM/ARMSubtarget.cpp
parent12e5aa81e6d5fed4ec2a96f0fe69d42699139133 (diff)
downloadexternal_llvm-a5de2fc079f65072277595a7a6e763762081a124.zip
external_llvm-a5de2fc079f65072277595a7a6e763762081a124.tar.gz
external_llvm-a5de2fc079f65072277595a7a6e763762081a124.tar.bz2
ARM target now also recognize triplets like thumbv6-apple-darwin and set thumb mode and arch subversion. Eventually thumb triplets will go way and replaced with function notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMSubtarget.cpp')
-rw-r--r--lib/Target/ARM/ARMSubtarget.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp
index f5a1840..2415a85 100644
--- a/lib/Target/ARM/ARMSubtarget.cpp
+++ b/lib/Target/ARM/ARMSubtarget.cpp
@@ -36,23 +36,30 @@ ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
// if one cannot be determined, to true.
const std::string& TT = M.getTargetTriple();
unsigned Len = TT.length();
- if (Len >= 5) {
- if (TT.substr(0, 4) == "armv") {
- unsigned SubVer = TT[4];
- if (SubVer > '4' && SubVer <= '9') {
- if (SubVer >= '6')
- ARMArchVersion = V6;
- else if (SubVer == '5') {
- ARMArchVersion = V5T;
- if (Len >= 7 && TT[5] == 't' && TT[6] == 'e')
- ARMArchVersion = V5TE;
- }
+ unsigned Idx = 0;
+ if (Len >= 5 && TT.substr(0, 4) == "armv")
+ Idx = 4;
+ else if (Len >= 6 && TT.substr(0, 6) == "thumb") {
+ IsThumb = true;
+ if (Len >= 7 && TT[5] == 'v')
+ Idx = 6;
+ }
+ if (Idx) {
+ unsigned SubVer = TT[Idx];
+ if (SubVer > '4' && SubVer <= '9') {
+ if (SubVer >= '6')
+ ARMArchVersion = V6;
+ else if (SubVer == '5') {
+ ARMArchVersion = V5T;
+ if (Len >= Idx+3 && TT[Idx+1] == 't' && TT[Idx+2] == 'e')
+ ARMArchVersion = V5TE;
}
}
}
- if (Len > 5) {
+ if (Len >= 10) {
if (TT.find("-darwin") != std::string::npos)
+ // arm-darwin
TargetType = isDarwin;
} else if (TT.empty()) {
#if defined(__APPLE__)