diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-05-15 21:07:09 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-05-15 21:07:09 +0000 |
commit | 9d92987a583981bc013f4a22f89d24df104f13da (patch) | |
tree | a7b8e6d44dd4aab3234f370d0ddf307305eb7ae5 /lib | |
parent | 39f229fdd3084dc995a1b45d94cde435c3a0a180 (diff) |
Merging r181750:
------------------------------------------------------------------------
r181750 | rafael | 2013-05-13 17:44:24 -0700 (Mon, 13 May 2013) | 4 lines
Use atomic instructions on linux thumb v7.
This matches gcc's behaviour. The patch also explicitly parses the version so
that this keeps working when we add support for v8.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_33@181920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Basic/Targets.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 841ca62ab6..a622a11aa5 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -3536,9 +3536,23 @@ class ARMTargetInfo : public TargetInfo { if (T.getOS() != llvm::Triple::Linux) return false; StringRef ArchName = T.getArchName(); - if (ArchName.startswith("armv6") || ArchName.startswith("armv7")) - return true; - return false; + if (T.getArch() == llvm::Triple::arm) { + if (!ArchName.startswith("armv")) + return false; + StringRef VersionStr = ArchName.substr(4); + unsigned Version; + if (VersionStr.getAsInteger(10, Version)) + return false; + return Version >= 6; + } + assert(T.getArch() == llvm::Triple::thumb); + if (!ArchName.startswith("thumbv")) + return false; + StringRef VersionStr = ArchName.substr(6); + unsigned Version; + if (VersionStr.getAsInteger(10, Version)) + return false; + return Version >= 7; } public: |