Basic: improve coverage for Darwin targets and fix ABI

The existing coverage for the Darwin targets wasn't enough to catch all
the variations.  Improve the coverage a bit further and fix a few cases
for Darwin targets.

llvm-svn: 316826
diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp
index bbbe75b..def490b 100644
--- a/clang/lib/Basic/Targets/ARM.cpp
+++ b/clang/lib/Basic/Targets/ARM.cpp
@@ -214,18 +214,23 @@
   bool IsOpenBSD = Triple.getOS() == llvm::Triple::OpenBSD;
   bool IsNetBSD = Triple.getOS() == llvm::Triple::NetBSD;
 
-  PtrDiffType = IntPtrType =
-      (Triple.isOSDarwin() || IsOpenBSD || IsNetBSD) ? SignedLong : SignedInt;
-
   // FIXME: the isOSBinFormatMachO is a workaround for identifying a Darwin-like
   // environment where size_t is `unsigned long` rather than `unsigned int`
+
+  PtrDiffType = IntPtrType =
+      (Triple.isOSDarwin() || Triple.isOSBinFormatMachO() || IsOpenBSD ||
+       IsNetBSD)
+          ? SignedLong
+          : SignedInt;
+
   SizeType = (Triple.isOSDarwin() || Triple.isOSBinFormatMachO() || IsOpenBSD ||
               IsNetBSD)
                  ? UnsignedLong
                  : UnsignedInt;
 
   // ptrdiff_t is inconsistent on Darwin
-  if (Triple.isOSDarwin() && !Triple.isWatchABI())
+  if ((Triple.isOSDarwin() || Triple.isOSBinFormatMachO()) &&
+      !Triple.isWatchABI())
     PtrDiffType = SignedInt;
 
   // Cache arch related info.