summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-03-08 04:02:49 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-03-08 04:02:49 +0000
commitec415efb4451acc3b94fd62d8fa7268ef6ddd52a (patch)
tree981f311f979c48d5a0c84a46e167c6402e9de30d /llvm/lib
parentdc35e5b43aa37e961d4603611ad7d47b7b96a0ed (diff)
downloadbcm5719-llvm-ec415efb4451acc3b94fd62d8fa7268ef6ddd52a.tar.gz
bcm5719-llvm-ec415efb4451acc3b94fd62d8fa7268ef6ddd52a.zip
Recognize triplets starting with armv5-, armv6- etc. And set the ARM arch version accordingly.
llvm-svn: 66365
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp
index bbc2202c3ba..f5a18405f9e 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.cpp
+++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp
@@ -35,7 +35,23 @@ ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
// Set the boolean corresponding to the current target triple, or the default
// if one cannot be determined, to true.
const std::string& TT = M.getTargetTriple();
- if (TT.length() > 5) {
+ 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;
+ }
+ }
+ }
+ }
+
+ if (Len > 5) {
if (TT.find("-darwin") != std::string::npos)
TargetType = isDarwin;
} else if (TT.empty()) {
OpenPOWER on IntegriCloud