Pull in r184040 from upstream clang trunk:

Emit native implementations of atomic operations on FreeBSD/armv6.

  Just like on Linux, FreeBSD/armv6 assumes the system supports
  ldrex/strex unconditionally. It is also used by the kernel. We can
  therefore enable support for it, like we do on Linux.

  While there, change one of the unit tests to explicitly test against
  armv5 instead of armv7, as it actually tests whether libcalls are
  emitted.
This commit is contained in:
Ed Schouten 2013-06-15 09:42:43 +00:00
parent 2d5add2ae6
commit d23f3f67b5

View File

@ -3533,8 +3533,8 @@ class ARMTargetInfo : public TargetInfo {
// the kernel which on armv6 and newer uses ldrex and strex. The net result
// is that if we assume the kernel is at least as recent as the hardware,
// it is safe to use atomic instructions on armv6 and newer.
if (T.getOS() != llvm::Triple::Linux)
return false;
if (T.getOS() != llvm::Triple::Linux && T.getOS() != llvm::Triple::FreeBSD)
return false;
StringRef ArchName = T.getArchName();
if (T.getArch() == llvm::Triple::arm) {
if (!ArchName.startswith("armv"))